Open mbhata opened 1 year ago
Hi @mbhata, please note that the module pkg_resources
is deprecated. We are providing maintenance to it, but I don't think performance parity is at the top of the priorities (specially because we also depend on 3rd party dependencies).
Have you considered using importlib.metadata.version
as a replacement for the example you provided?
You can also use importlib.metadata.distribution
to get a distribution object...
setuptools version
65.3.0
Python version
3.9.16
OS
custom linux distro
Additional environment information
issue observed env: openssl version -> 3.0.8 cryptography -> 40.0.2 setuptool -> 65.3.0 this issue is observed in all usecases that is imporitng setuptool package.
Description
As part of upgrading openssl to 3.0.8 version, there requires indirect dependency with setuptools package, hence upgraded to version 65.3.0 to match with minimum requirement to openssl.
After update ,there is some degrade in performance during the runtime which is observed to be appeared from setuptools approx 0.6 seconds more than usual as the total number of calls are getting increased for same code when executed with two different setuptool version
Is this expected behaviour ?
Expected behavior
number of calls and total time taken should be approx same when setuptools upgraded to (65.3.0)
How to Reproduce
sample Script uscase where the issue can be observed easily
Output
profiling of openssl(3.0.8) + cryptography( 40.0.2) + setuptool upgrade(65.3.0)
/usr/lib/python3.9/sitepackages/pkg_resources/_vendor/packaging/version.py
is coming from setuptools and this is always topping the list of functions which is causing more time. This file/methods from this file were not at all listed when profiling on the old versions.profiling of openssl(1.1.1o) + cryptography( 3.2.1) + setuptool upgrade(57.0.0)
=========================================================================== Sample scripts output:
profiling of openssl(3.0.8) + cryptography( 40.0.2) + setuptool upgrade(65.3.0)
================================================================
profiling of openssl(1.1.1o) + cryptography( 3.2.1) + setuptool upgrade(57.0.0)
================================================================