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

Function BenchmarkRevTreePruning

db/revtree_test.go:1169–1197  ·  view source on GitHub ↗

BENCHMARK:

(b *testing.B)

Source from the content-addressed store, hash-verified

1167// ////// BENCHMARK:
1168
1169func BenchmarkRevTreePruning(b *testing.B) {
1170
1171 // Try large rev tree with multiple branches
1172 branchSpecs := []BranchSpec{
1173 {
1174 NumRevs: 60,
1175 Digest: "non-winning unresolved",
1176 LastRevisionIsTombstone: false,
1177 },
1178 {
1179 NumRevs: 25,
1180 Digest: "non-winning tombstoned",
1181 LastRevisionIsTombstone: true,
1182 },
1183 }
1184
1185 ctx := base.TestCtx(b)
1186 b.ResetTimer()
1187
1188 for i := 0; i < b.N; i++ {
1189
1190 b.StopTimer()
1191 revTree := getMultiBranchTestRevtree1(ctx, 50, 100, branchSpecs)
1192 b.StartTimer()
1193
1194 revTree.pruneRevisions(ctx, 50, "")
1195 }
1196
1197}
1198
1199func BenchmarkRevtreeUnmarshal(b *testing.B) {
1200 doc := Document{

Callers

nothing calls this directly

Calls 3

TestCtxFunction · 0.92
pruneRevisionsMethod · 0.45

Tested by

no test coverage detected