-
Notifications
You must be signed in to change notification settings - Fork 409
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
bench: add GC stats to bench #8063
bench: add GC stats to bench #8063
Conversation
3838e2f
to
26d4c63
Compare
I'm now testing this with #8052 to see any memory change. Edit: As expected, there is a decrease of 200 in the minor word count. |
Now I will repush the bench commit and then push #8035. Edit: No observable change in this one. |
708319f
to
9f9d24d
Compare
9f9d24d
to
44b8993
Compare
bench/bench.ml
Outdated
let+ times = | ||
Process.run_with_times dune ~display:Quiet ~stdin_from ~stdout_to ~stderr_to | ||
[ "build"; "@install"; "--release" ] | ||
in | ||
times.elapsed_time | ||
(* Run GC and compactify before querying GC stats *) | ||
Gc.full_major (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're handling the GC in the wrong process here. It's the dune command above that should spit out its GC stats.
To do this, you could add some --dump-gc-stats-end=FILE
argument that would add an at_exit
hook to dump this info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added that option in #8072 (which is currently also included here). The data I'm getting now makes much more sense. I'll try to test out your PRs again.
cd555ee
to
cbb92ab
Compare
OK this time testing #8052 again. cc @rgrinberg So the only observable changes are: Major collectionsOn clean build went from 30 to 37 and on null build decreased from 23 to 22. Heap wordsOn null build went from Free wordsOn null build free words appear to have halved from ConclusionOverall, I'm not really sure if I understand what this change does to the memory. |
b2c621c
to
79f702d
Compare
This time trying #8035. No changes observed really. |
33c776c
to
9b6f4c9
Compare
d0ff5e9
to
2ff8805
Compare
8774c2e
to
fe62fbe
Compare
Signed-off-by: Ali Caglayan <[email protected]>
fe62fbe
to
55730a2
Compare
Awesome. Great work. |
Problem
We want to have a convenient way of tracking memory gains in PRs. There is no way to do this currently apart from measuring Dune's perf by yourself.
Solution
We start collecting Gc.stats in each of our build runs in the bench. In order to do so we introduce a
Metrics
module which is sufficiently polymorphic to support an unzipping operation which is useful when serialising to json. The mli of theMetrics
module has some detailed documentation about the metrics that we collect about a process.During the build runs, we garbage collect and compacitify before observing the statistics.
This PR changes the names of the benchmark jobs to be more uniform (use title case). This has the side effect of discontinuing previous runs, although the old data is still available in the website. Due to this I have bumped the version number of the bench.
We also enable sandboxing in the bench.
hacking.rst
bench documentation