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 web3 costs a lot of memory #2767

Closed
SerK0 opened this issue Dec 22, 2022 · 2 comments
Closed

Importing web3 costs a lot of memory #2767

SerK0 opened this issue Dec 22, 2022 · 2 comments

Comments

@SerK0
Copy link

SerK0 commented Dec 22, 2022

Hi!
When I import some class from web3 lib I see that my script starting to use 25Mb.
Is it possible to decrease this amount? Is it available light weighted version?
Is it possible to import some class without importing all web3 module?

@EyalMuga
Copy link

One way to reduce memory usage is to only import the specific classes or functions that you need for your script, rather than importing the entire web3 module
you can use a web3 light-weighted library, such as py-evm, which is a library that provides a lightweight implementation of the Ethereum virtual machine (EVM) and its associated blockchain, while still providing compatibility with the web3.py API.

@SerK0
Copy link
Author

SerK0 commented Jan 26, 2023

Thank for your answer, strangly haven't seen py-evm...

@pacrob pacrob closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2023
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

3 participants