Skip to content

Assertion/revert optimizations#2198

Merged
iamdefinitelyahuman merged 4 commits into
vyperlang:masterfrom
iamdefinitelyahuman:optimize-assert
Oct 15, 2020
Merged

Assertion/revert optimizations#2198
iamdefinitelyahuman merged 4 commits into
vyperlang:masterfrom
iamdefinitelyahuman:optimize-assert

Conversation

@iamdefinitelyahuman

Copy link
Copy Markdown
Contributor

What I did

LLL-level optimizations around assertions and reverts.

How I did it

  • check the assertion before storing the error string in memory
  • use revert macro instead of assert where possible
  • avoid assert check if test statement is a literal

How to verify it

Run tests.

Cute Animal Picture

image

@codecov-io

codecov-io commented Oct 15, 2020

Copy link
Copy Markdown

Codecov Report

Merging #2198 into master will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2198      +/-   ##
==========================================
- Coverage   85.30%   85.26%   -0.04%     
==========================================
  Files          83       83              
  Lines        8524     8523       -1     
  Branches     2061     2063       +2     
==========================================
- Hits         7271     7267       -4     
- Misses        747      748       +1     
- Partials      506      508       +2     
Impacted Files Coverage Δ
vyper/compile_lll.py 92.55% <ø> (-1.01%) ⬇️
vyper/opcodes.py 100.00% <ø> (ø)
vyper/optimizer.py 83.07% <100.00%> (-0.26%) ⬇️
vyper/parser/stmt.py 80.76% <100.00%> (+0.48%) ⬆️

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 f0db419...ab48ad8. Read the comment docs.

Comment thread vyper/compile_lll.py
Comment thread vyper/opcodes.py
Comment thread vyper/optimizer.py
Comment thread tests/compiler/LLL/test_optimize_lll.py
@iamdefinitelyahuman iamdefinitelyahuman merged commit 704b3f2 into vyperlang:master Oct 15, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the optimize-assert branch October 15, 2020 01:51
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.

3 participants