Skip to content

Optimization: division safemath when divisor is a literal#2173

Merged
fubuloubu merged 1 commit into
vyperlang:masterfrom
iamdefinitelyahuman:optimize-safemath
Sep 29, 2020
Merged

Optimization: division safemath when divisor is a literal#2173
fubuloubu merged 1 commit into
vyperlang:masterfrom
iamdefinitelyahuman:optimize-safemath

Conversation

@iamdefinitelyahuman

Copy link
Copy Markdown
Contributor

What I did

Remove the safemath check when dividing by a literal value.

How I did it

If the divisor is a literal, remove the clamp_nonzero instruction within the LLL.

How to verify it

Run tests.

Cute Animal Picture

image

@codecov-commenter

codecov-commenter commented Sep 29, 2020

Copy link
Copy Markdown

Codecov Report

Merging #2173 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2173      +/-   ##
==========================================
+ Coverage   85.22%   85.23%   +0.01%     
==========================================
  Files          83       83              
  Lines        8330     8336       +6     
  Branches     2009     2011       +2     
==========================================
+ Hits         7099     7105       +6     
  Misses        731      731              
  Partials      500      500              
Impacted Files Coverage Δ
vyper/parser/expr.py 77.04% <100.00%> (+0.28%) ⬆️

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 1b7a215...c3bfd17. Read the comment docs.

@fubuloubu fubuloubu merged commit 332a025 into vyperlang:master Sep 29, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the optimize-safemath branch September 29, 2020 19:18
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