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

Assertion/revert optimizations #2198

Merged

Conversation

iamdefinitelyahuman
Copy link
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
Copy link

codecov-io commented Oct 15, 2020

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.

vyper/compile_lll.py Show resolved Hide resolved
vyper/opcodes.py Show resolved Hide resolved
vyper/optimizer.py Show resolved Hide resolved
@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