Closed greatroar closed 1 year ago
I did Digest too, for completeness' sake:
name old speed new speed delta
DigestBytes/4B-8 324MB/s ± 1% 354MB/s ± 0% +9.05% (p=0.000 n=9+10)
DigestBytes/16B-8 1.00GB/s ± 1% 1.07GB/s ± 0% +6.76% (p=0.000 n=9+9)
DigestBytes/100B-8 3.54GB/s ± 1% 3.67GB/s ± 1% +3.74% (p=0.000 n=10+10)
DigestBytes/4KB-8 9.54GB/s ± 1% 9.65GB/s ± 0% +1.11% (p=0.000 n=10+8)
DigestBytes/10MB-8 9.63GB/s ± 1% 9.63GB/s ± 1% ~ (p=0.968 n=9+10)
DigestString/4B-8 311MB/s ± 0% 334MB/s ± 0% +7.50% (p=0.000 n=8+7)
DigestString/16B-8 973MB/s ± 1% 1036MB/s ± 0% +6.43% (p=0.000 n=9+10)
DigestString/100B-8 3.50GB/s ± 1% 3.60GB/s ± 0% +2.95% (p=0.000 n=10+9)
DigestString/4KB-8 9.51GB/s ± 4% 9.64GB/s ± 0% +1.38% (p=0.028 n=10+9)
DigestString/10MB-8 9.64GB/s ± 2% 9.67GB/s ± 0% ~ (p=0.222 n=9+9)
Nice improvement! Thanks for sending it along.
Benchmark results on amd64 -tags=purego:
For very short inputs, the purego version is now competitive with the asm version. For anything longer than a few bytes, not quite (old=asm, new=purego):