MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / BenchmarkInjectJSONProperties

Function BenchmarkInjectJSONProperties

base/util_test.go:1277–1304  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

1275}
1276
1277func BenchmarkInjectJSONProperties(b *testing.B) {
1278 newKV := KVPair{
1279 Key: "newval",
1280 Val: 123,
1281 }
1282
1283 tests := []struct {
1284 input string
1285 }{
1286 {
1287 input: `null`,
1288 },
1289 {
1290 input: "{}",
1291 },
1292 {
1293 input: `{"key":"val"}`,
1294 },
1295 }
1296
1297 for _, test := range tests {
1298 b.Run(test.input, func(bb *testing.B) {
1299 for i := 0; i < bb.N; i++ {
1300 _, _ = InjectJSONProperties([]byte(test.input), newKV)
1301 }
1302 })
1303 }
1304}
1305
1306func BenchmarkInjectJSONProperties_Multiple(b *testing.B) {
1307 newKVs := []KVPair{

Callers

nothing calls this directly

Calls 2

InjectJSONPropertiesFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected