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

convert to lazy loading to speed import times #298

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pacrob
Copy link
Contributor

@pacrob pacrob commented Dec 13, 2024

What was wrong?

eth-utils takes a bit to load.

Related to Issue #293
Closes #293

How was it fixed?

Convert to lazy loading. Tested to make sure all things that could be imported before this change can still be imported.

Before:

In [1]: %time from eth_utils import to_checksum_address
CPU times: user 120 ms, sys: 9.05 ms, total: 129 ms
Wall time: 128 ms

After:

In [1]: %time from eth_utils import to_checksum_address
CPU times: user 39.6 ms, sys: 2.97 ms, total: 42.6 ms
Wall time: 41.3 ms

Todo:

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

image

@pacrob pacrob force-pushed the lazy-load branch 3 times, most recently from 56d230f to e336af8 Compare December 13, 2024 19:57
@pacrob pacrob marked this pull request as draft December 13, 2024 19:57
@pacrob pacrob self-assigned this Dec 13, 2024
@pacrob pacrob changed the title convert to lazy loading so only requested modules are loaded convert to lazy loading to speed import times Dec 13, 2024
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 this pull request may close these issues.

Improve module load / import performance
1 participant