Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007456OCamlmiscpublic2017-01-09 16:552017-02-23 16:52
Reporterkayceesrk 
Assigned Toshinwell 
PrioritynormalSeveritymajorReproducibilityalways
StatusassignedResolutionopen 
Platformx86-64OSUbuntuOS Version16.04
Product Version4.04.0 
Target Version4.05.0+devFixed in Version 
Summary0007456: Compilation on 4.04.0 takes twice as long as 4.03.0
DescriptionWhile trying to reproduce the issue 0007452, I noticed that the compilation with 4.04.0 takes twice as long as compiling the same file with 4.03.0. I've attached the timing info:

4.03.0
-------
all: 31.864s
parsing(test.ml): 0.544s
typing(test.ml): 2.516s
transl(test.ml): 0.476s
generate(test.ml): 28.324s
cmm(sourcefile(test.ml)): 0.572s
compile_phrases(sourcefile(test.ml)): 23.968s
selection(sourcefile(test.ml)): 1.696s
comballoc(sourcefile(test.ml)): 0.176s
cse(sourcefile(test.ml)): 1.036s
deadcode(sourcefile(test.ml)): 0.600s
spill(sourcefile(test.ml)): 2.548s
liveness(sourcefile(test.ml)): 2.664s
split(sourcefile(test.ml)): 1.008s
regalloc(sourcefile(test.ml)): 12.932s
linearize(sourcefile(test.ml)): 0.204s
emit(sourcefile(test.ml)): 0.980s
scheduling(sourcefile(test.ml)): 0.012s
assemble(sourcefile(test.ml)): 0.004s

real 1m7.576s
user 1m6.860s
sys 0m0.540s

4.04.0
-------
all: 82.040s
parsing(test.ml): 0.560s
typing(test.ml): 2.480s
transl(test.ml): 0.516s
generate(test.ml): 78.480s
cmm(sourcefile(test.ml)): 0.552s
compile_phrases(sourcefile(test.ml)): 30.496s
selection(sourcefile(test.ml)): 1.812s
comballoc(sourcefile(test.ml)): 0.256s
cse(sourcefile(test.ml)): 1.268s
deadcode(sourcefile(test.ml)): 0.716s
spill(sourcefile(test.ml)): 3.088s
split(sourcefile(test.ml)): 1.656s
liveness(sourcefile(test.ml)): 3.576s
regalloc(sourcefile(test.ml)): 16.236s
linearize(sourcefile(test.ml)): 0.356s
emit(sourcefile(test.ml)): 1.316s
scheduling(sourcefile(test.ml)): 0.000s
assemble(sourcefile(test.ml)): 0.004s

real 2m19.632s
user 2m18.336s
sys 0m1.140s
Steps To ReproduceRequires opam package extprot to be installed.

* Download and untar https://caml.inria.fr/mantis/file_download.php?file_id=1658&type=bug [^] to get test.ml
* Compile as: time ocamlfind opt -c -g -bin-annot -ccopt -g -ccopt -O2 -ccopt -Wextra -ccopt '-Wstrict-overflow=5' -thread -w +a-4-40..42-44-45-48-58 -w -27-32 -package extprot test.ml -o test.cmx
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0017136)
gasche (developer)
2017-01-09 19:07

(just looking at the data and making obvious conclusion) the overhead seems to come from "generate" then "compile_phrases" (although the latter could just come from "generate" producing sensibly more code to compile: all backend passes seem to be 30%-60% slower, which is consistent with more code being produced):

4.03.0:
-------
generate(test.ml): 28.324s
compile_phrases(sourcefile(test.ml)): 23.968s

4.04.0:
-------
generate(test.ml): 78.480s
compile_phrases(sourcefile(test.ml)): 30.496s
(0017139)
kayceesrk (reporter)
2017-01-10 11:10
edited on: 2017-01-10 11:11

The numbers themselves are quite suspect and don't seem to add up. For example, with the 4.03.0 numbers:

all: 31.864s

parsing(test.ml): 0.544s
typing(test.ml): 2.516s
transl(test.ml): 0.476s
generate(test.ml): 28.324s
                               -------
                               31.86s
                               -------

cmm(sourcefile(test.ml)): 0.572s
compile_phrases(sourcefile(test.ml)): 23.968s
selection(sourcefile(test.ml)): 1.696s
comballoc(sourcefile(test.ml)): 0.176s
cse(sourcefile(test.ml)): 1.036s
deadcode(sourcefile(test.ml)): 0.600s
spill(sourcefile(test.ml)): 2.548s
liveness(sourcefile(test.ml)): 2.664s
split(sourcefile(test.ml)): 1.008s
regalloc(sourcefile(test.ml)): 12.932s
linearize(sourcefile(test.ml)): 0.204s
emit(sourcefile(test.ml)): 0.980s
scheduling(sourcefile(test.ml)): 0.012s
assemble(sourcefile(test.ml)): 0.004s
                                               --------
                                               55.440s
                                               --------

On 4.04.0:

all: 82.040s

parsing(test.ml): 0.560s
typing(test.ml): 2.480s
transl(test.ml): 0.516s
generate(test.ml): 78.480s
                               -------
                               82.036s
                               -------

cmm(sourcefile(test.ml)): 0.552s
compile_phrases(sourcefile(test.ml)): 30.496s
selection(sourcefile(test.ml)): 1.812s
comballoc(sourcefile(test.ml)): 0.256s
cse(sourcefile(test.ml)): 1.268s
deadcode(sourcefile(test.ml)): 0.716s
spill(sourcefile(test.ml)): 3.088s
split(sourcefile(test.ml)): 1.656s
liveness(sourcefile(test.ml)): 3.576s
regalloc(sourcefile(test.ml)): 16.236s
linearize(sourcefile(test.ml)): 0.356s
emit(sourcefile(test.ml)): 1.316s
scheduling(sourcefile(test.ml)): 0.000s
assemble(sourcefile(test.ml)): 0.004s
                                               --------
                                               61.332s
                                               --------

I suspect an unrelated bug in the timing infrastructure.

(0017141)
joris (reporter)
2017-01-10 13:15

Thank you for looking at this. I noticed this too but i'm so used to the really long compile time of this file that i didn't even think about submitting a PR.
(0017354)
xleroy (administrator)
2017-02-19 18:29

So, suspect numbers or real issue? Has anyone looked at the sizes of intermediate representations to get an idea of where the code gets bigger? Anyone willing to investigate?
(0017398)
frisch (developer)
2017-02-22 16:57

Bumping severity. Such a regression in compiler performance is not a minor issue.
(0017407)
shinwell (developer)
2017-02-23 11:12

I will look at this

- Issue History
Date Modified Username Field Change
2017-01-09 16:55 kayceesrk New Issue
2017-01-09 19:07 gasche Note Added: 0017136
2017-01-10 11:10 kayceesrk Note Added: 0017139
2017-01-10 11:11 kayceesrk Note Edited: 0017139 View Revisions
2017-01-10 13:15 joris Note Added: 0017141
2017-02-19 18:29 xleroy Note Added: 0017354
2017-02-22 16:57 frisch Note Added: 0017398
2017-02-22 16:57 frisch Severity minor => major
2017-02-22 16:57 frisch Target Version => 4.05.0+dev
2017-02-23 11:12 shinwell Note Added: 0017407
2017-02-23 11:12 shinwell Assigned To => shinwell
2017-02-23 11:12 shinwell Status new => assigned
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-02-23 16:52 doligez Category -OCaml general => misc


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker