New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.02.0 compiles modules twice slower than 4.01 #6529
Comments
Comment author: @xavierleroy Smoking gun (shown by "perf" profiling): significant time is spent in List.assoc (none in 4.01) and (consequently) significantly more time in polymorphic comparison. |
Comment author: @xavierleroy Fixed quadratic-time code in Consistbl.extract (commit 15169 in 4.02, 15170 on trunk). Compilation time for Why3 is down to 11.0s user time, from 15.6s in 4.02 and 8.6s in 4.01. The remaining 1.4s are unaccounted for (yet). |
Comment author: @lpw25 The fix to The quadratic code was already around most uses of When I wrote |
Comment author: @alainfrisch Following Leo's advice, I've committed a change to Env (15171 on trunk, 15172 on 4.02) to (i) avoid duplicates in imported_units (using a StringSet instead of a list) and (ii) avoid repeated consistency checks for the same unit (adding a bool ref to the cache of loaded persistent units to remember which ones have already been checked). Compiling typing/typecore.ml now takes 0.52s (0.76s before the change) with ocamlopt.opt and 2.24s (3.52s before) with ocamlopt. Since we're discussing performances of the compiler, it's also worth noting that tweaking GC parameters can have a huge impact on them. For instance, compiling typing/typecore.ml with ocamlopt.opt takes only 0.35s (instead of 0.52s) with OCAMLRUNPARAM=s=64M. |
Comment author: jpdeplaix Great ! Here is the new results on why3:
and for js_of_ocaml:
Thanks a lot ! :) |
Comment author: @xavierleroy Thanks for the retest. The approx 10% overhead that remains can be caused by many different things (e.g. ocamlopt 4.02 performs two additional optimization passes compared with 4.01) and I don't think it is worth deeper investigation. Marking this PR as resolved. |
Comment author: jpdeplaix Just for information, when do you think the 4.02.1 can be released ? |
Comment author: @lpw25
This is what the |
Comment author: @alainfrisch Thanks Leo, I've moved the flag to the pers_struct record. |
…sistency check). git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.02@15172 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
… of pers_struct). git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.02@15175 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Original bug ID: 6529
Reporter: jpdeplaix
Status: closed (set by @xavierleroy on 2016-12-07T10:34:38Z)
Resolution: fixed
Priority: high
Severity: major
Version: 4.02.0+beta1 / +rc1
Fixed in version: 4.02.1+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @bobzhang @hcarty @yakobowski
Bug description
ocaml/opam-repository#2547
Steps to reproduce
Just test with any OCaml program.
The text was updated successfully, but these errors were encountered: