Description
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.