Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
original code from: https://github.com/holiman/uint256 gnoswap implementation: https://github.com/gnoswap-labs/gnoswap/tree/main/packages/big/uint256 ref: #1698 (comment) here's the metrics for reference: ```plain // gno test -v=true -print-runtime-metrics=true ./ === RUN TestAdd --- PASS: TestAdd (0.00s) --- runtime: cycle=25.9k imports=3 allocs=756.0k(0.15%) === RUN TestSub --- PASS: TestSub (0.00s) --- runtime: cycle=54.7k imports=3 allocs=1.5M(0.30%) === RUN TestMul --- PASS: TestMul (0.00s) --- runtime: cycle=76.5k imports=3 allocs=2.1M(0.42%) === RUN TestDiv --- PASS: TestDiv (0.00s) --- runtime: cycle=87.6k imports=3 allocs=2.5M(0.50%) === RUN TestMod --- PASS: TestMod (0.00s) --- runtime: cycle=100.8k imports=3 allocs=3.0M(0.59%) === RUN TestDivMod --- PASS: TestDivMod (0.00s) --- runtime: cycle=128.8k imports=3 allocs=4.0M(0.80%) === RUN TestNeg --- PASS: TestNeg (0.00s) --- runtime: cycle=203.1k imports=3 allocs=5.5M(1.10%) === RUN TestExp --- PASS: TestExp (0.00s) --- runtime: cycle=356.9k imports=3 allocs=8.7M(1.73%) === RUN TestOr === RUN TestOr/all_zeros --- PASS: TestOr/all_zeros (0.00s) === RUN TestOr/all_ones --- PASS: TestOr/all_ones (0.00s) === RUN TestOr/mixed --- PASS: TestOr/mixed (0.00s) === RUN TestOr/one_operand_all_ones --- PASS: TestOr/one_operand_all_ones (0.00s) --- PASS: TestOr (0.00s) --- runtime: cycle=364.2k imports=3 allocs=9.0M(1.80%) === RUN TestAnd === RUN TestAnd/all_zeros --- PASS: TestAnd/all_zeros (0.00s) === RUN TestAnd/all_ones --- PASS: TestAnd/all_ones (0.00s) === RUN TestAnd/mixed --- PASS: TestAnd/mixed (0.00s) === RUN TestAnd/mixed_2 --- PASS: TestAnd/mixed_2 (0.00s) === RUN TestAnd/mixed_3 --- PASS: TestAnd/mixed_3 (0.00s) === RUN TestAnd/one_operand_zero --- PASS: TestAnd/one_operand_zero (0.00s) === RUN TestAnd/one_operand_all_ones --- PASS: TestAnd/one_operand_all_ones (0.00s) --- PASS: TestAnd (0.00s) --- runtime: cycle=376.6k imports=3 allocs=9.6M(1.92%) === RUN TestNot === RUN TestNot/all_zeros --- PASS: TestNot/all_zeros (0.00s) === RUN TestNot/all_ones --- PASS: TestNot/all_ones (0.00s) === RUN TestNot/mixed --- PASS: TestNot/mixed (0.00s) --- PASS: TestNot (0.00s) --- runtime: cycle=381.2k imports=3 allocs=9.8M(1.97%) === RUN TestAndNot === RUN TestAndNot/all_zeros --- PASS: TestAndNot/all_zeros (0.00s) === RUN TestAndNot/all_ones --- PASS: TestAndNot/all_ones (0.00s) === RUN TestAndNot/mixed --- PASS: TestAndNot/mixed (0.00s) === RUN TestAndNot/mixed_2 --- PASS: TestAndNot/mixed_2 (0.00s) === RUN TestAndNot/mixed_3 --- PASS: TestAndNot/mixed_3 (0.00s) === RUN TestAndNot/one_operand_zero --- PASS: TestAndNot/one_operand_zero (0.00s) === RUN TestAndNot/one_operand_all_ones --- PASS: TestAndNot/one_operand_all_ones (0.00s) --- PASS: TestAndNot (0.00s) --- runtime: cycle=393.6k imports=3 allocs=10.4M(2.08%) === RUN TestXor === RUN TestXor/all_zeros --- PASS: TestXor/all_zeros (0.00s) === RUN TestXor/all_ones --- PASS: TestXor/all_ones (0.00s) === RUN TestXor/mixed --- PASS: TestXor/mixed (0.00s) === RUN TestXor/mixed_2 --- PASS: TestXor/mixed_2 (0.00s) === RUN TestXor/mixed_3 --- PASS: TestXor/mixed_3 (0.00s) === RUN TestXor/one_operand_zero --- PASS: TestXor/one_operand_zero (0.00s) === RUN TestXor/one_operand_all_ones --- PASS: TestXor/one_operand_all_ones (0.00s) --- PASS: TestXor (0.00s) --- runtime: cycle=406.0k imports=3 allocs=11.0M(2.20%) === RUN TestLsh --- PASS: TestLsh (0.00s) --- runtime: cycle=531.2k imports=3 allocs=13.8M(2.77%) === RUN TestRsh --- PASS: TestRsh (0.00s) --- runtime: cycle=636.1k imports=3 allocs=16.3M(3.25%) === RUN TestCmp --- PASS: TestCmp (0.00s) --- runtime: cycle=647.6k imports=3 allocs=16.7M(3.34%) === RUN TestIsZero --- PASS: TestIsZero (0.00s) --- runtime: cycle=650.3k imports=3 allocs=16.8M(3.36%) === RUN TestLtUint64 --- PASS: TestLtUint64 (0.00s) --- runtime: cycle=656.1k imports=3 allocs=17.0M(3.40%) === RUN TestSGT --- PASS: TestSGT (0.00s) --- runtime: cycle=666.1k imports=3 allocs=17.2M(3.44%) === RUN TestEq --- PASS: TestEq (0.00s) --- runtime: cycle=714.3k imports=3 allocs=18.2M(3.64%) === RUN TestIsUint64 --- PASS: TestIsUint64 (0.00s) --- runtime: cycle=719.5k imports=3 allocs=18.3M(3.67%) === RUN TestDec === RUN TestDec/zero --- PASS: TestDec/zero (0.00s) === RUN TestDec/less_than_20_digits --- PASS: TestDec/less_than_20_digits (0.00s) === RUN TestDec/max_possible_value --- PASS: TestDec/max_possible_value (0.00s) --- PASS: TestDec (0.00s) --- runtime: cycle=735.2k imports=3 allocs=18.9M(3.78%) ok ./ 0.61s ``` cc: @r3v4s @dongwon8247 @mconcat --------- Co-authored-by: n3wbie <r3v4@onbloc.xyz>
- Loading branch information