Skip to content
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 from apitools.base.py submodules is slow #232

Open
HarrisonGregg opened this issue Jun 14, 2018 · 0 comments
Open

Importing from apitools.base.py submodules is slow #232

HarrisonGregg opened this issue Jun 14, 2018 · 0 comments

Comments

@HarrisonGregg
Copy link
Contributor

apitools/base/py/__init__.py imports everything from all of its submodules. This makes it easier to import things in the submodules, as you don't have to worry about which submodule its in, but it comes at the price of significant overhead when importing anything from any of the submodules, as all of the submodules (and everything they import) have to be imported too. On my machine, this takes about 160ms. These imports should be removed as wildcard imports in an __init__.py file are generally bad practice and have specific consequences in this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant