BENCHMARK:
(b *testing.B)
| 1167 | // ////// BENCHMARK: |
| 1168 | |
| 1169 | func 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 | |
| 1199 | func BenchmarkRevtreeUnmarshal(b *testing.B) { |
| 1200 | doc := Document{ |
nothing calls this directly
no test coverage detected