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: lazy source traceback in transaction errors #2211

Merged
merged 9 commits into from
Aug 16, 2024

Conversation

antazoey
Copy link
Member

@antazoey antazoey commented Aug 8, 2024

What I did

I had a dream last night that this was the last remaining performance problem.
Basically all call-based Vm errors seems to calculate their source tbs when they don't always have to.
I am hoping by lazy-ifying this, we re-gain some of performance loss from 0.6.22

How I did it

How to verify it

Checklist

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

@antazoey antazoey force-pushed the feat/lazier-err-tb branch 2 times, most recently from 96b4b33 to 119219d Compare August 8, 2024 18:50
@antazoey antazoey marked this pull request as ready for review August 8, 2024 20:15
fubuloubu
fubuloubu previously approved these changes Aug 8, 2024
fubuloubu
fubuloubu previously approved these changes Aug 14, 2024
@antazoey
Copy link
Member Author

One example of the performance gain (I am sure there are other cases):

Code:

%time cont.setNumber(5, sender=acct, raise_on_revert=False)

Before:

CPU times: user 264 ms, sys: 8.98 ms, total: 273 ms
Wall time: 391 ms
Out[14]: <Receipt 0x07ea2a17817d0be7191df511223b8d1a2d306390a9c0d93642d59ca026d5dcee>

After:

CPU times: user 209 ms, sys: 7.28 ms, total: 217 ms
Wall time: 322 ms
Out[5]: <Receipt 0x4ea4be20d1949ee762e9f331dd9598c213397e01e13f33bb0c4bd7d37893305c>

^ In this case it's because we are not calculated the ape-traceback because it isnt being raised, because of the raise_on_revert=False flag

@antazoey antazoey merged commit 3f85a75 into ApeWorX:main Aug 16, 2024
15 checks passed
@antazoey antazoey deleted the feat/lazier-err-tb branch August 16, 2024 18:48
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