mirror of
https://github.com/octoleo/restic.git
synced 2025-01-23 23:28:32 +00:00
Add BenchmarkFindUsedBlobs
This commit is contained in:
parent
2c04ad3c29
commit
162629571d
@ -116,3 +116,23 @@ func TestFindUsedBlobs(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkFindUsedBlobs(b *testing.B) {
|
||||
repo, cleanup := repository.TestRepository(b)
|
||||
defer cleanup()
|
||||
|
||||
sn := TestCreateSnapshot(b, repo, findTestTime, findTestDepth, 0)
|
||||
|
||||
b.ResetTimer()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
seen := pack.NewBlobSet()
|
||||
blobs := pack.NewBlobSet()
|
||||
err := FindUsedBlobs(repo, *sn.Tree, blobs, seen)
|
||||
if err != nil {
|
||||
b.Error(err)
|
||||
}
|
||||
|
||||
b.Logf("found %v blobs", len(blobs))
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user