I have a fairly stable project github.com/robaho/fixed <http://github.com/robaho/fixed> which is almost 100% cpu bound. It doesn’t change so it makes a great way to compare the performance of different Go versions using the same hardware. I took the time to re-run the tests today.
Using 1.21.17: BenchmarkAddFixed-8 2000000000 0.59 ns/op 0 B/op 0 allocs/op BenchmarkAddDecimal-8 5000000 243 ns/op 176 B/op 8 allocs/op BenchmarkAddBigInt-8 100000000 14.3 ns/op 0 B/op 0 allocs/op BenchmarkAddBigFloat-8 20000000 78.8 ns/op 48 B/op 1 allocs/op BenchmarkMulFixed-8 300000000 4.88 ns/op 0 B/op 0 allocs/op BenchmarkMulDecimal-8 20000000 72.0 ns/op 80 B/op 2 allocs/op BenchmarkMulBigInt-8 100000000 17.1 ns/op 0 B/op 0 allocs/op BenchmarkMulBigFloat-8 30000000 35.5 ns/op 0 B/op 0 allocs/op BenchmarkDivFixed-8 300000000 4.71 ns/op 0 B/op 0 allocs/op BenchmarkDivDecimal-8 2000000 779 ns/op 568 B/op 21 allocs/op BenchmarkDivBigInt-8 30000000 46.1 ns/op 8 B/op 1 allocs/op BenchmarkDivBigFloat-8 20000000 108 ns/op 24 B/op 2 allocs/op BenchmarkCmpFixed-8 2000000000 0.38 ns/op 0 B/op 0 allocs/op BenchmarkCmpDecimal-8 200000000 8.05 ns/op 0 B/op 0 allocs/op BenchmarkCmpBigInt-8 300000000 5.87 ns/op 0 B/op 0 allocs/op BenchmarkCmpBigFloat-8 300000000 5.46 ns/op 0 B/op 0 allocs/op BenchmarkStringFixed-8 20000000 57.4 ns/op 32 B/op 1 allocs/op BenchmarkStringNFixed-8 20000000 55.6 ns/op 32 B/op 1 allocs/op BenchmarkStringDecimal-8 10000000 218 ns/op 64 B/op 5 allocs/op BenchmarkStringBigInt-8 10000000 122 ns/op 24 B/op 2 allocs/op BenchmarkStringBigFloat-8 3000000 416 ns/op 192 B/op 8 allocs/op BenchmarkWriteTo-8 30000000 45.8 ns/op 18 B/op 0 allocs/op and version 1.21.5: BenchmarkAddFixed-8 1000000000 0.9735 ns/op 0 B/op 0 allocs/op BenchmarkAddDecimal-8 14311995 69.99 ns/op 80 B/op 2 allocs/op BenchmarkAddBigInt-8 100000000 13.42 ns/op 0 B/op 0 allocs/op BenchmarkAddBigFloat-8 17506702 63.84 ns/op 48 B/op 1 allocs/op BenchmarkMulFixed-8 313983104 3.732 ns/op 0 B/op 0 allocs/op BenchmarkMulDecimal-8 18046520 66.59 ns/op 80 B/op 2 allocs/op BenchmarkMulBigInt-8 100000000 10.79 ns/op 0 B/op 0 allocs/op BenchmarkMulBigFloat-8 49186024 24.30 ns/op 0 B/op 0 allocs/op BenchmarkDivFixed-8 306888069 3.721 ns/op 0 B/op 0 allocs/op BenchmarkDivDecimal-8 2510688 462.4 ns/op 384 B/op 12 allocs/op BenchmarkDivBigInt-8 33993822 37.02 ns/op 8 B/op 1 allocs/op BenchmarkDivBigFloat-8 9415330 111.5 ns/op 24 B/op 2 allocs/op BenchmarkCmpFixed-8 1000000000 0.2548 ns/op 0 B/op 0 allocs/op BenchmarkCmpDecimal-8 168714549 7.086 ns/op 0 B/op 0 allocs/op BenchmarkCmpBigInt-8 234895634 4.952 ns/op 0 B/op 0 allocs/op BenchmarkCmpBigFloat-8 260814464 4.503 ns/op 0 B/op 0 allocs/op BenchmarkStringFixed-8 23725470 50.57 ns/op 24 B/op 1 allocs/op BenchmarkStringNFixed-8 23666628 50.67 ns/op 24 B/op 1 allocs/op BenchmarkStringDecimal-8 5665790 200.1 ns/op 56 B/op 4 allocs/op BenchmarkStringBigInt-8 10596398 100.2 ns/op 16 B/op 1 allocs/op BenchmarkStringBigFloat-8 2922332 391.2 ns/op 176 B/op 7 allocs/op BenchmarkWriteTo-8 45734523 31.53 ns/op 23 B/op 0 allocs/op which is pretty impressive across the board. Only 2 tests show any degradation and most show significant improvement. On the two that degrade, AddFixed is a fairly trivial add of 2 longs, so that is surprising. Strangely, WriteTo shows a different number of B/op on different runs (all of the other tests are stable). -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/A6412E4C-03BD-477B-A725-06510DDD618A%40me.com.