-
Notifications
You must be signed in to change notification settings - Fork 371
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
[2.1.0~alpha] opam show is noticably slower, loading depexts #4172
Comments
This can come from the depext check. At each switch load, as for external file dependencies, depext checks that required system packages are still present. |
The depext check is lazy and I believe it shouldn't be forced on |
@rjbou found it: there is actually a It would be possible to print the highest version instead, to avoid the cost, but might be annoying in some cases (like packages where versions are actually triggers, e.g. Or, more involved, it would be possible to compute the availability specifically for the package without forcing the whole stuff. |
It is indeed possible to compute availability only with subset of targeted packages, but a package availability depends on depexts, we still need to load it. A more optimised solution is to load depexts only for targeted packages also, it's still an exec call, but given the system package manager it can be faster.
it is already the case, if pkg is not ① in pinned ② in installed ③ in available, the default is the highest version of all packages. |
Also |
@vbmithr You can see what takes time with |
With #4165 (latest master) it takes around 1s instead of 2 for me. However it is still 3x slower than with 2.0.7. Here is the output with
|
From the log, the repo cache takes 0.3s and the invariant to infer 0.3 more. Setting the invariant with |
wouldn't it be interesting to set this invariant automatically when opam detects an upgrade to 2.1 from previous versions? Isn't that related to #4188? |
It is the same mechanism involved, indeed. My previous comment is more a hint, until this is fixed/improved/next release. |
Just a follow-up on this: there is no change whether or not the switch has been upgraded from 2.0 or created fresh. |
#4998 fixes partially this issue |
Using opam master (3def1a6), the following command:
takes less than
0.3s
on opam 2.0.7 vs. almost2s
with opam 2.1.0~alpha.The text was updated successfully, but these errors were encountered: