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

Add a benchmark for opam list --installed on non-installed packages #6149

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ users)
* Make the benchmark setup process faster and the benchmark itself more stable [#6094 @kit-ty-kate]
* Add a benchmark showing the current performance of OpamVersionCompare [#6078 @kit-ty-kate]
* Add a benchmark for `opam install --check` [#6123 @kit-ty-kate]
* Add a benchmark for `opam list --installed` on non-installed packages [#6149 @kit-ty-kate]

## Reftests
### Tests
Expand Down
11 changes: 11 additions & 0 deletions tests/bench/bench.ml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ let () =
launch (fmt "%s switch create five --fake ocaml-base-compiler.4.14.0" bin);
time_cmd ~exit:1 (fmt "%s install --check core.v0.15.0" bin)
in
let time_list_installed_noninstalled_packages =
Gc.compact ();
launch (fmt "%s switch create six --empty" bin);
time_cmd ~exit:0 (fmt "%s list --installed --short --safe --color=never ocp-indent ocp-index merlin" bin)
kit-ty-kate marked this conversation as resolved.
Show resolved Hide resolved
in
let json = fmt {|{
"results": [
{
Expand Down Expand Up @@ -138,6 +143,11 @@ let () =
"name": "opam install --check on a non-installed package",
"value": %f,
"units": "secs"
},
{
"name": "opam list --installed on non-installed packages",
"value": %f,
"units": "secs"
}
]
},
Expand All @@ -161,6 +171,7 @@ let () =
time_OpamPackage_Version_compare_100
time_install_check_installed
time_install_check_not_installed
time_list_installed_noninstalled_packages
bin_size
in
print_endline json
Loading