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[venom]: improve OrderedSet operations #4246

Merged

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Sep 18, 2024

What I did

improve time spent in venom by 25%

How I did it

dict views support set operations, https://docs.python.org/3/library/stdtypes.html#dict-views

How to verify it

check time vyper --optimize none vs time vyper --experimental-codegen --optimize none for a large-ish vyper contract

Commit message

improve time spent in venom by 25%

dict views support set operations, which allows us to loop, using
`&=`. since our intersections are typically not between a large number
of OrderedSets, this results in faster execution time.

references:
- https://docs.python.org/3/library/stdtypes.html#dict-views

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

roughly 10% improvement in venom section
dict.keys().__iand__ for better performance, roughly 20% improvement for
time spent in venom
@charles-cooper charles-cooper merged commit 957c8ed into vyperlang:master Sep 25, 2024
156 checks passed
@charles-cooper charles-cooper deleted the perf/orderedset-intersection branch September 25, 2024 15:27
charles-cooper added a commit to charles-cooper/vyper that referenced this pull request Oct 5, 2024
improve time spent in venom by 25%

dict views support set operations, which allows us to loop, using
`&=`. since our intersections are typically not between a large number
of OrderedSets, this results in faster execution time.

references:
- https://docs.python.org/3/library/stdtypes.html#dict-views
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