forked from TrueCloudLab/restic
Improve BenchmarkIndexSave
This commit is contained in:
parent
c4f44c7bcb
commit
dac18e3bf8
1 changed files with 15 additions and 1 deletions
|
@ -141,12 +141,26 @@ func BenchmarkIndexNew(b *testing.B) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkIndexSave(b *testing.B) {
|
func BenchmarkIndexSave(b *testing.B) {
|
||||||
repo, cleanup := createFilledRepo(b, 3, 0)
|
repo, cleanup := repository.TestRepository(b)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
idx, err := New(repo, nil)
|
idx, err := New(repo, nil)
|
||||||
test.OK(b, err)
|
test.OK(b, err)
|
||||||
|
|
||||||
|
for i := 0; i < 8000; i++ {
|
||||||
|
entries := make([]restic.Blob, 0, 200)
|
||||||
|
for j := 0; j < len(entries); j++ {
|
||||||
|
entries = append(entries, restic.Blob{
|
||||||
|
ID: restic.NewRandomID(),
|
||||||
|
Length: 1000,
|
||||||
|
Offset: 5,
|
||||||
|
Type: restic.DataBlob,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
idx.AddPack(restic.NewRandomID(), 10000, entries)
|
||||||
|
}
|
||||||
|
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
|
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
|
|
Loading…
Reference in a new issue