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

Improve performance of some opam list combination #4999

Merged
merged 4 commits into from
Jan 18, 2022

Conversation

kit-ty-kate
Copy link
Member

With master (f39739b):

$ time opam list --available --installable -s --all-version dune.2.9.1
dune.2.9.1
opam list --available --installable -s --all-version dune.2.9.1  54.60s user 0.60s system 99% cpu 55.278 total

With this PR:

$ time opam list --available --installable -s --all-version dune.2.9.1
dune.2.9.1
./opam list --available --installable -s --all-version dune.2.9.1  2.91s user 0.37s system 98% cpu 3.317 total

Incidently, this also makes OpamListCommand.filter correct. Previously it would simply ignore its ~base parameter if the request did not start with a And case

@kit-ty-kate
Copy link
Member Author

For --conflicts-with we get a 3x improvement. E.g. with opam master (f39739b):

$ time opam list --installed --conflicts-with base-domains.base -s --all-version
js_of_ocaml-compiler.3.11.0
opam list --installed --conflicts-with base-domains.base -s --all-version  0.97s user 0.33s system 97% cpu 1.339 total

With this PR:

$ time ./opam list --installed --conflicts-with base-domains.base -s --all-version
js_of_ocaml-compiler.3.11.0
./opam list --installed --conflicts-with base-domains.base -s --all-version  0.39s user 0.05s system 96% cpu 0.461 total

Copy link
Member

@AltGr AltGr left a comment

Choose a reason for hiding this comment

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

Seems good, thanks!

src/client/opamListCommand.ml Show resolved Hide resolved
src/client/opamListCommand.ml Outdated Show resolved Hide resolved
src/client/opamListCommand.ml Outdated Show resolved Hide resolved
@rjbou rjbou added this to the 2.2.0~alpha milestone Jan 17, 2022
@kit-ty-kate kit-ty-kate merged commit dca4f25 into ocaml:master Jan 18, 2022
@kit-ty-kate kit-ty-kate deleted the perf-improvement-list branch January 18, 2022 12:04
rjbou pushed a commit to rjbou/opam that referenced this pull request Apr 22, 2022
Improve performance of some opam list combination
@rjbou rjbou mentioned this pull request Apr 22, 2022
4 tasks
rjbou pushed a commit to rjbou/opam that referenced this pull request Apr 27, 2022
Improve performance of some opam list combination
rjbou pushed a commit to rjbou/opam that referenced this pull request Jul 12, 2022
Improve performance of some opam list combination
@rjbou rjbou modified the milestones: 2.2.0~alpha, 2.1.3 Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants