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

Size limit optimizations #2175

Merged

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

Optimizations around size clamps.

How I did it

  • When compiling for >= constantinople rules, handle sizelimits for address and bool using shr instead of a comparison to the in-memory size limit.
  • During LLL optimization, check for unused size limit values. If any are found, remove the initial mstore operation to reduce the size of the bytecode.

How to verify it

Run tests.

Cute Animal Picture

image

@fubuloubu
Copy link
Member

Really need to test this one across EVM versions. Does that happen?

@codecov-commenter
Copy link

codecov-commenter commented Sep 29, 2020

Codecov Report

Merging #2175 into master will increase coverage by 0.01%.
The diff coverage is 91.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2175      +/-   ##
==========================================
+ Coverage   85.23%   85.25%   +0.01%     
==========================================
  Files          83       83              
  Lines        8336     8367      +31     
  Branches     2011     2019       +8     
==========================================
+ Hits         7105     7133      +28     
- Misses        731      732       +1     
- Partials      500      502       +2     
Impacted Files Coverage Δ
vyper/optimizer.py 79.41% <88.46%> (+2.48%) ⬆️
vyper/parser/arg_clamps.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 332a025...87a5993. Read the comment docs.

@iamdefinitelyahuman iamdefinitelyahuman merged commit 0b5669d into vyperlang:master Sep 30, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the optimize-clamps branch September 30, 2020 00:08
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