--- end-to-end Get with a string value ------------------------------------- Verifies that stringEnd's fast path actually shows up in a realistic call.
(b *testing.B)
| 84 | // Verifies that stringEnd's fast path actually shows up in a realistic call. |
| 85 | |
| 86 | func BenchmarkGet_StringValue_NoEscape(b *testing.B) { |
| 87 | data := []byte(`{"key":"` + strings.Repeat("a", 128) + `"}`) |
| 88 | b.SetBytes(int64(len(data))) |
| 89 | b.ResetTimer() |
| 90 | for i := 0; i < b.N; i++ { |
| 91 | _, _, _, _ = Get(data, "key") |
| 92 | } |
| 93 | } |