(b *testing.B, s string)
| 15 | } |
| 16 | |
| 17 | func benchmarkAppendJSONString(b *testing.B, s string) { |
| 18 | b.ReportAllocs() |
| 19 | b.SetBytes(int64(len(s))) |
| 20 | b.RunParallel(func(pb *testing.PB) { |
| 21 | var buf []byte |
| 22 | for pb.Next() { |
| 23 | buf = AppendJSONString(buf[:0], s, true) |
| 24 | } |
| 25 | }) |
| 26 | } |
| 27 | |
| 28 | func BenchmarkAppendJSONStringViaStrconv(b *testing.B) { |
| 29 | b.Run("no-special-chars", func(b *testing.B) { |
no test coverage detected
searching dependent graphs…