--- tokenEnd --------------------------------------------------------------- Common case: a bare scalar value (number, boolean, null) terminated by a delimiter. The fast path uses bytes.IndexAny (SIMD) to find it.
(b *testing.B)
| 52 | // delimiter. The fast path uses bytes.IndexAny (SIMD) to find it. |
| 53 | |
| 54 | func BenchmarkTokenEnd_Number(b *testing.B) { |
| 55 | // Typical short number terminated by a comma. |
| 56 | data := []byte(`1234567890,`) |
| 57 | b.SetBytes(int64(len(data))) |
| 58 | b.ResetTimer() |
| 59 | for i := 0; i < b.N; i++ { |
| 60 | _ = tokenEnd(data) |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | func BenchmarkTokenEnd_LongNumber(b *testing.B) { |
| 65 | // A 64-digit number — exercises the SIMD scan. |
nothing calls this directly
no test coverage detected