A simple benchmark comparing push and pull iterators to each other and also comparing them to themselves with and without PGO.
goos: linux
goarch: amd64
pkg: test
cpu: AMD Ryzen 9 3900X 12-Core Processor
│ no-pgo.txt │ pgo.txt │
│ sec/op │ sec/op vs base │
Push-24 116.5n ± 6% 107.4n ± 2% -7.77% (p=0.000 n=10)
Pull-24 2.047µ ± 2% 1.994µ ± 7% -2.57% (p=0.009 n=10)
geomean 488.2n 462.8n -5.20%
│ no-pgo.txt │ pgo.txt │
│ B/op │ B/op vs base │
Push-24 24.00 ± 0% 24.00 ± 0% ~ (p=1.000 n=10) ¹
Pull-24 352.0 ± 0% 352.0 ± 0% ~ (p=1.000 n=10) ¹
geomean 91.91 91.91 +0.00%
¹ all samples are equal
│ no-pgo.txt │ pgo.txt │
│ allocs/op │ allocs/op vs base │
Push-24 2.000 ± 0% 2.000 ± 0% ~ (p=1.000 n=10) ¹
Pull-24 12.00 ± 0% 12.00 ± 0% ~ (p=1.000 n=10) ¹
geomean 4.899 4.899 +0.00%
¹ all samples are equal