Skip to content

Conversation

@jannotti
Copy link
Contributor

@jannotti jannotti commented Sep 4, 2021

Summary

Removes some code, but more importantly speeds up mulw considerably.
We have always charged 1 unit of cost for mulw, but it was actually
more expensive. This fixes that.

A nice side-effect is that opPlus/opAddw and opMul/opMulw are
simplified and easier to follow. Benchmarks confirm nothing is
slower (and mulw is ~5 times faster).

Test Plan

All tests of opAddwImpl and opMulwImpl have been retained by
conducting the same test with actual teal, instead of directly testing
those (now non-existent) functions.

@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2021

Codecov Report

Merging #2839 (3144f68) into master (e32b2c2) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2839      +/-   ##
==========================================
- Coverage   47.28%   47.24%   -0.04%     
==========================================
  Files         351      351              
  Lines       56381    56359      -22     
==========================================
- Hits        26659    26629      -30     
- Misses      26730    26736       +6     
- Partials     2992     2994       +2     
Impacted Files Coverage Δ
data/transactions/logic/eval.go 89.38% <100.00%> (+0.19%) ⬆️
ledger/blockqueue.go 82.18% <0.00%> (-2.88%) ⬇️
agreement/cryptoVerifier.go 75.73% <0.00%> (-2.21%) ⬇️
agreement/proposalManager.go 96.07% <0.00%> (-1.97%) ⬇️
catchup/peerSelector.go 98.95% <0.00%> (-1.05%) ⬇️
network/requestTracker.go 70.25% <0.00%> (-0.87%) ⬇️
catchup/service.go 69.35% <0.00%> (-0.78%) ⬇️
ledger/acctupdates.go 62.13% <0.00%> (-0.42%) ⬇️
network/wsNetwork.go 61.09% <0.00%> (+0.18%) ⬆️
cmd/tealdbg/debugger.go 73.86% <0.00%> (+1.00%) ⬆️
... and 1 more

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 e32b2c2...3144f68. Read the comment docs.

@jannotti jannotti self-assigned this Sep 4, 2021
Removes some code, but more importantly speeds up mulw considerably.
We have always charged 1 unit of cost for mulw, but it was actually
more expensive.  This fixes that.

A nice side-effect is that opPlus/opAddw and opMul/opMulw are
simplified and easier to follow.  Benchmarks confirm nothing is
slower (and mulw is ~5 times faster).

All tests of opAddwImpl and opMulwImpl have been retained by
conducting the same test with actual teal, instead of directly testing
those (now non-existent) functions.
@jannotti jannotti merged commit f8169d2 into algorand:master Sep 4, 2021
@jannotti jannotti deleted the bits-math branch January 28, 2022 15:41
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