Skip to content
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

Make the benchmark setup process faster and the benchmark itself more stable #6094

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

kit-ty-kate
Copy link
Member

Required for #6078 as it makes the new benchmarks stable enough to be merged.

RUN find "$(pwd)/opam-repository" -name opam -type f > /home/opam/all-opam-files
RUN opam init --bare -n --disable-sandboxing /rep/opam-repository
RUN opam switch create --fake default 4.14.0
RUN find /rep/opam-repository -name opam -type f > /home/opam/all-opam-files
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading file bench test depends on OPAMREPOSHA, that can evolve in the future.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure but we'd see that evolution on the graph associated with the commit changing it so i don't think this is an issue.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea of these benches is to have them stable over the time, to only see changes related to test target, no?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stable over runs yes, not necessarily stable over time, i would say. Benchmark stable over time is an extremely sticky thing to do and i don't think we should meddle with that (e.g. at some point in the future the machine running those benchmarks will die and the result of the bench will change)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course we can't rely on it indefinitely, as it depends on a machine, but i think that we shouldn't have a benchmark that changes if an external value changes (here repo hash). In fact, it is the same for other opam install bench tests too, they depend son that repo hash too.
Anyway, in the future if we need to change that hash, we can update the test accordingly (e.g. have 2 repo hashes).

launch "opam switch create two --empty";
launch "opam switch set-invariant core -n --sw two";
time_cmd ~exit:0 (fmt "%s install magic-trace -y --fake --sw two" bin)
in
let time_OpamSystem_read_10 =
let time_OpamSystem_read_100 =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reading bench test concerns reading a lot of opam files. Do we want to have also a test for reading huge file too? Currently (with this hash), all-opam-files file is 1.3M.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think so given the overwhelming present use-case of OpamSystem.read. Also i don't think this should be done in this PR if we'd want to do that. This PR is only for stability and performance improvements.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough

Copy link
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@rjbou rjbou merged commit b288aa6 into ocaml:master Jul 24, 2024
2 checks passed
@kit-ty-kate kit-ty-kate deleted the improve-bench branch July 24, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants