============================================================================= Micro-benchmarks for the fast-path optimizations modeled on PR #285. Each benchmark measures one of the optimized hot paths on inputs that exercise (a) the common-case fast path and (b) the rare-case slow path, so the bef
(b *testing.B)
| 19 | // bytes.IndexByte (SIMD on amd64/arm64) to skip the per-byte scan. |
| 20 | |
| 21 | func BenchmarkStringEnd_NoEscape_Short(b *testing.B) { |
| 22 | data := []byte(`hello world"`) |
| 23 | b.SetBytes(int64(len(data))) |
| 24 | b.ResetTimer() |
| 25 | for i := 0; i < b.N; i++ { |
| 26 | _, _ = stringEnd(data) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | func BenchmarkStringEnd_NoEscape_Long(b *testing.B) { |
| 31 | // 128-byte string value, no escapes — exercises the SIMD fast path. |
nothing calls this directly
no test coverage detected