-
Notifications
You must be signed in to change notification settings - Fork 148
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
Importing humanize is slow #209
Comments
An alternative is using https://github.com/pypa/setuptools_scm/#retrieving-package-version-at-runtime Would you like to test to see if that improves things? It would be nice to see some numbers comparing both, and against setting a dummy value for the version. |
Here are the results of Constantimportlib_metadatapkg_resources |
Thanks for this! That's such a big difference, perhaps we could try out the https://github.com/pypa/setuptools_scm/#configuration-parameters Would you like to put together a PR? |
Sounds good, will do tomorrow. |
Note to self and future: Since the version file that setuptools writes to doesn't exist during development, we'll need to guard the import just like in pypa/setuptools-scm#143 (comment). |
Does installing in editiable mode ( |
Closed by #227. |
Is the new |
It is not good enough to consider constant but it is 3 times faster than it was before, which is why I closed this. Happy to reopen if you think that there is more to be done. |
I have noticed that importing humanize noticeably increases the startup time of my CLI. After doing some
importtime
analysis, I think the underlying problem is that importingpkg_resources
is slow.Is is it possible to replace the usage of
pkg_resources.get_distribution
in__init__.py
with something that isn't as expensive to import?The text was updated successfully, but these errors were encountered: