mirror of
https://github.com/restic/restic.git
synced 2024-12-23 08:16:36 +00:00
repository: add benchmark for MasterIndex.Each
This commit is contained in:
parent
b48766d7b8
commit
825b95e313
1 changed files with 14 additions and 0 deletions
|
@ -308,6 +308,20 @@ func BenchmarkMasterIndexLookupBlobSize(b *testing.B) {
|
|||
}
|
||||
}
|
||||
|
||||
func BenchmarkMasterIndexEach(b *testing.B) {
|
||||
rng := rand.New(rand.NewSource(0))
|
||||
mIdx, _ := createRandomMasterIndex(b, rand.New(rng), 5, 200000)
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
entries := 0
|
||||
for _ = range mIdx.Each(context.TODO()) {
|
||||
entries++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
snapshotTime = time.Unix(1470492820, 207401672)
|
||||
depth = 3
|
||||
|
|
Loading…
Reference in a new issue