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

Improve module load / import performance #293

Open
antazoey opened this issue Dec 10, 2024 · 0 comments · May be fixed by #298
Open

Improve module load / import performance #293

antazoey opened this issue Dec 10, 2024 · 0 comments · May be fixed by #298

Comments

@antazoey
Copy link
Contributor

What feature should we add?

In some contexts, such as usage in modules that are meant to load super fast, importing from eth-utils becomes a little bottleneck.

In [1]: %time from eth_utils import to_checksum_address
CPU times: user 175 ms, sys: 9.1 ms, total: 184 ms
Wall time: 183 ms

Comparing it to Pydantic for no reason.

In [2]: %time from pydantic import BaseModel
CPU times: user 54.2 ms, sys: 7.14 ms, total: 61.3 ms
Wall time: 60.4 ms

I am just softly wondering if we can put forth some efforts to making this import faster.

Use-case:

  1. Using in modules for CLI tools, which should load super fast so that using --help and such is fast.
  2. Using in exceptions, logging, or other utils modules, which are somewhat expected to load fast.

Workaround

Can use localized imports, but that comes with other problems

@pacrob pacrob linked a pull request Dec 13, 2024 that will close this issue
3 tasks
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

Successfully merging a pull request may close this issue.

1 participant