Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007456OCamlOCaml generalpublic2017-01-09 16:552017-01-10 21:05
Reporterkayceesrk 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusnewResolutionopen 
Platformx86-64OSUbuntuOS Version16.04
Product Version4.04.0 
Target VersionFixed 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.

- 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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker