-
Notifications
You must be signed in to change notification settings - Fork 75
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
Printing of Apron
values very slow
#1513
Comments
Turns out almost all the time is spent constructing and printing pretty_diffs: (if D.leq v1 v2 then nil else dprintf "diff: %a\n" D.pretty_diff (v1, v2))
++
(if D.leq v2 v1 then nil else dprintf "reverse diff: %a\n" D.pretty_diff (v2, v1)) This takes several orders of magnitude more than just doing the comparisons. |
It seems to be somehow not the actual implementation inside apronDomain.ml of |
The culprit seems to in fact be |
Which in turn come from Apron, so there must be something super slow happening in Apron. |
The flamegraph on the other hand hints at a majority of time (90%) being spent in Perf data in Firefox format: https://gigamove.rwth-aachen.de/en/download/039038f988c7dfbc813e63447a35a0b1(accessible until 07.10). This does not seem to be a blocker for my thesis, as I will generate missing reports manually in non-verbose mode, but we should look at it. |
privPrecCompare
respect timeoutsApron
values very slow
Apparently the I suspect the Apron printer is using |
Maybe something can be done here by using See e.g. the performance numbers reported here: https://gist.github.com/mooreryan/220b47feea6b253630dab09c4b6ed18c |
https://github.com/ocaml/ocaml/blob/107e8d3851f840e00c9c94118d70b74c06995d56/stdlib/string.ml#L225 this seems to avoid all of the intermediate allocating. |
let custom_text (s:string) =
let lines = String.split_on_char '\n' s in
let rec doit = function
| [] -> nil
| [x1] -> text x1
| x1::xs -> (text x1) ++ line ++ doit xs
in
doit lines
let pretty () (x:t) = custom_text (show x) instead of let pretty () (x:t) = text (show x) Already goes from me running out of patience and killing it (while not even 1/4 done) after
to
That solution obviously is not tail-recursive, but even if we allow some overhead for that it still seems to be the clearly superior approach. |
This is actual even almost a case of tail_mod_cons, but it's not clear to the compiler because |
I let it run to the end
So the difference is almost an order of magnitude. |
After making the analysis more precise by a patch for #1535 we once again have a case where precision comparison takes >33h, while analysis takes only 15min for the most involved setting. |
Also, it allocates over 50GB of RAM. |
Ok, this was still pretty-printing somehow behaving irrationally, if that is disabled, it works in a manner of minutes rather than 35 hours, |
With
verbose
mode, we observe terrible slowdowns that seem to be due to very slow pretty-printing.Currently, they are not considered which is bad for long-running benchmarks whereprivPrecCompare
may take a long time or even fail to terminate.The text was updated successfully, but these errors were encountered: