Generate the baseline for comparison:
$ env go test -bench=Template -count=10 > no-block-profiler.txt
Block rate of 1000
(or 1 microsecond) shows a 140% increase in latency:
$ env BLOCK_RATE=1000 go test -bench=Template -count=10 > block-profiler-rate-1000.txt
$ ~/go/bin/benchstat no-block-profiler.txt block-profiler-rate-1000.txt
name old time/op new time/op delta
Template-8 6.76µs ± 3% 16.56µs ± 1% +144.94% (p=0.000 n=10+10)
Block rate of 10000
(10 microseconds) shows 10% increase:
$ env BLOCK_RATE=10000 go test -bench=Template -count=10 > block-profiler-rate-10000.txt
$ ~/go/bin/benchstat no-block-profiler.txt block-profiler-rate-10000.txt
name old time/op new time/op delta
Template-8 6.76µs ± 3% 7.52µs ± 2% +11.27% (p=0.000 n=10+9)
Block rate of 10000000
(1 millisecond) shows 5% increase:
$ env BLOCK_RATE=1000000 go test -bench=Template -count=10 > block-profiler-rate-1000000.txt
$ ~/go/bin/benchstat no-block-profiler.txt block-profiler-rate-1000000.txt
name old time/op new time/op delta
Template-8 6.76µs ± 3% 7.15µs ± 4% +5.84% (p=0.000 n=10+9)