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

feat[venom]: optimize get_basic_block() #4002

Merged
merged 9 commits into from
May 8, 2024

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented May 4, 2024

What I did

How I did it

How to verify it

Commit message

`get_basic_block()` is a hotspot in venom (up to 35% of total
compilation time!). this optimizes `get_basic_block()`, on a large
contract near the 24kb limit this reduces time spent in venom from 3s to
1s (total time from 6s to 4s).

note on the same contract, time spent in the IRnode optimizer pipeline
is 2s - so time in venom is now smaller than time in legacy optimizer(!)

notes:
- refactor to use dict for basic_blocks
- clean up basic blocks API 
    hide basic blocks behind `get_basic_blocks()` iterator and
    `num_basic_blocks`.

Description for the changelog

Cute Animal Picture

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

@charles-cooper charles-cooper requested a review from harkal May 4, 2024 19:52
@charles-cooper charles-cooper changed the title optimize get_basic_block feat[venom]: optimize get_basic_block() May 4, 2024
vyper/venom/function.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented May 5, 2024

Codecov Report

Attention: Patch coverage is 71.87500% with 18 lines in your changes are missing coverage. Please review.

Project coverage is 88.01%. Comparing base (3af5390) to head (093c4f3).

❗ Current head 093c4f3 differs from pull request most recent head 81d7311. Consider uploading reports for the commit 81d7311 to get more accurate results

Files Patch % Lines
vyper/venom/function.py 76.47% 7 Missing and 1 partial ⚠️
vyper/venom/passes/simplify_cfg.py 46.15% 5 Missing and 2 partials ⚠️
vyper/venom/analysis/dominators.py 0.00% 1 Missing ⚠️
vyper/venom/ir_node_to_venom.py 66.66% 1 Missing ⚠️
vyper/venom/passes/normalization.py 50.00% 0 Missing and 1 partial ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4002      +/-   ##
==========================================
- Coverage   90.86%   88.01%   -2.86%     
==========================================
  Files         103      103              
  Lines       14908    14905       -3     
  Branches     3304     3303       -1     
==========================================
- Hits        13546    13118     -428     
- Misses        941     1291     +350     
- Partials      421      496      +75     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@charles-cooper charles-cooper marked this pull request as ready for review May 5, 2024 13:26
@charles-cooper charles-cooper requested a review from harkal May 5, 2024 13:26
vyper/venom/function.py Outdated Show resolved Hide resolved
@charles-cooper charles-cooper merged commit 93147be into vyperlang:master May 8, 2024
151 checks passed
@charles-cooper charles-cooper deleted the perf/optimize-venom branch May 8, 2024 14:42
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.

None yet

3 participants