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 the performance of importing from ape.exceptions #2407

Merged
merged 3 commits into from
Dec 11, 2024

Conversation

antazoey
Copy link
Member

What I did

This should be fast as ever.
This gets it a bit faster.

Before:

In [1]: %time from ape.exceptions import ContractLogicError
CPU times: user 236 ms, sys: 15.9 ms, total: 252 ms
Wall time: 251 ms

After:

In [1]: %time from ape.exceptions import ContractLogicError
CPU times: user 76.1 ms, sys: 13.5 ms, total: 89.7 ms
Wall time: 88.6 ms

It will be even better if I can improve ape.logging

How I did it

Instead of importing from eth_utils (which is very slow), do simple logic myself.

How to verify it

tests still pass should suffice

Checklist

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

@antazoey antazoey enabled auto-merge (squash) December 11, 2024 19:26
@antazoey antazoey merged commit f924acf into ApeWorX:main Dec 11, 2024
18 checks passed
@antazoey antazoey deleted the perf/exceptions branch December 12, 2024 18:06
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