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: RPC / provider level speed optimizations #2193

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

antazoey
Copy link
Member

What I did

A collection of perfs to make Ape faster... ongoing research and implementation..

How I did it

How to verify it

Checklist

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

fubuloubu
fubuloubu previously approved these changes Jul 30, 2024
src/ape_ethereum/ecosystem.py Show resolved Hide resolved
fubuloubu
fubuloubu previously approved these changes Jul 30, 2024
@antazoey
Copy link
Member Author

antazoey commented Jul 31, 2024

before (main):

In [3]: %time contract = owner.deploy(project.VyperContract, 123)
Wall time: 108 ms

In [4]: %time contract = owner.deploy(project.VyperContract, 123)
Wall time: 96.2 ms

In [5]: %time contract = owner.deploy(project.VyperContract, 123)
Wall time: 93.9 ms

after (this PR):

In [2]: %time contract = owner.deploy(project.VyperContract, 123)
Wall time: 100 ms

In [3]: %time contract = owner.deploy(project.VyperContract, 123)
Wall time: 87.5 ms

In [4]: %time contract = owner.deploy(project.VyperContract, 123)
Wall time: 87.8 ms

Ape 0.6.22 (supposedly the faster version of Ape):

In [3]: %time contract = owner.deploy(project.VyperContract, 123)
Wall time: 372 ms

In [3]: %time contract = owner.deploy(project.VyperContract, 123)
Wall time: 103 ms

In [4]: %time contract = owner.deploy(project.VyperContract, 123)
Wall time: 125 ms

src/ape/api/networks.py Outdated Show resolved Hide resolved
@antazoey
Copy link
Member Author

antazoey commented Aug 1, 2024

More metrics:

Name (time in ms)          Min       Max      Mean  StdDev    Median     IQR

before:
test_showt            463.9104  479.3264  471.3744  6.1150  471.2911  9.7154


after
test_showt            361.3695  461.4727  383.7982  43.4572  365.1572  25.610

@antazoey antazoey force-pushed the perf/pytest branch 2 times, most recently from 1d069de to 9befa1c Compare August 1, 2024 20:24
@antazoey antazoey changed the title perf: Making Ape faster perf: RPC / provider level speed optimizations Aug 1, 2024
@antazoey antazoey marked this pull request as ready for review August 1, 2024 21:26
fubuloubu
fubuloubu previously approved these changes Aug 2, 2024
@antazoey antazoey merged commit b046e1b into ApeWorX:main Aug 2, 2024
15 checks passed
@antazoey antazoey deleted the perf/pytest branch August 2, 2024 19: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