uint256: minor improvement for Mul#167
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #167 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 1628 1626 -2
=========================================
- Hits 1628 1626 -2 |
|
Interesting! @chfast lgty? |
|
New: https://go.godbolt.org/z/5E8TahK9j With Go 1.22.1, the new code has 7 less |
chfast
left a comment
There was a problem hiding this comment.
LGTM as this only moves the values to different variables and changes the order of operations.
godbolt has also the "diff view": https://go.godbolt.org/z/ddcK6TzKK It looks the new code spills less values from registers to stack. Good change. |
Minor tweek of the code. Not sure where the boost comes from. But it does improve around 10% in my two x86-64 machines.
godbolt links:
old: https://go.godbolt.org/z/z8vqhG9r7
new: https://go.godbolt.org/z/M17Ycfzxx
Test
Benchmark