You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been investigating performance issue in Pip reported here: pypa/pip#12314
I've created a fork that caches as many calls to packaging from Pip as I can easily implement.
However one of the biggest performance issues, taking 30% of the runtime of this example on my forked version of Pip, is canonicalize_version, unfortunately it is not called directly by pip but instead called by _canonical_spec, which is called by _IndividualSpecifier.__eq__ which is called by SpecifierSet.__eq__ which is called by two different sites in Pip.
It seems caching Pip's calls to SpecifierSet.__eq__ is ineffective as there are far more SpecifierSet value pairs than values returned by canonicalize_version.
I do not have an obvious solution at this time, but I wanted to bring this to your attention in case I am missing something.
The text was updated successfully, but these errors were encountered:
notatallshaw
changed the title
Canonicalize version is slow and needs to be called a lot, but can't easily be cached externally
Canonicalize version is slow and needs to be called a lot by Pip, but can't easily be cached externally
Oct 6, 2023
I've been investigating performance issue in Pip reported here: pypa/pip#12314
I've created a fork that caches as many calls to packaging from Pip as I can easily implement.
However one of the biggest performance issues, taking 30% of the runtime of this example on my forked version of Pip, is
canonicalize_version
, unfortunately it is not called directly by pip but instead called by_canonical_spec
, which is called by_IndividualSpecifier.__eq__
which is called bySpecifierSet.__eq__
which is called by two different sites in Pip.It seems caching Pip's calls to
SpecifierSet.__eq__
is ineffective as there are far moreSpecifierSet
value pairs than values returned bycanonicalize_version
.I do not have an obvious solution at this time, but I wanted to bring this to your attention in case I am missing something.
The text was updated successfully, but these errors were encountered: