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

perf: improve performance of project.get_contract() #2166

Merged
merged 2 commits into from
Jul 2, 2024

Conversation

antazoey
Copy link
Member

@antazoey antazoey commented Jul 1, 2024

What I did

The performance of getting contracts from projects is bad because it pointlessly always reloaded the manifest. Mistake! Fixed!

For testing, using a MASSIVE PROJECT.

With change:

In [1]: %time project.get_contract("MyContract")
CPU times: user 116 ms, sys: 12 ms, total: 128 ms
Wall time: 132 ms

Without change:

In [1]: %time project.get_contract("MyContract")
CPU times: user 1min 19s, sys: 2.88 s, total: 1min 22s
Wall time: 1min 22s

Improvement≈99.84%

So, the performance improvement is approximately 99.84%.

How I did it

delete code.
test.

How to verify it

Checklist

  • All changes are completed
  • New test cases have been added
  • Documentation has been updated

@antazoey antazoey merged commit 9481f4e into ApeWorX:main Jul 2, 2024
17 checks passed
@antazoey antazoey deleted the perf/get-contract-always-reloading branch July 2, 2024 01:24
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.

2 participants