Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
JkLondon committed Jul 15, 2024
1 parent 721c73e commit dda3575
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions mdbx/cursor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1608,51 +1608,6 @@ func BenchmarkCursor_Set_OneKey(b *testing.B) {
}
}

func BenchmarkCursor_SetRange_Sequence(b *testing.B) {
env, _ := setup(b)

var db DBI
keys := make([][]byte, b.N, b.N)
for i := range keys {
keys[i] = make([]byte, 8)
binary.BigEndian.PutUint64(keys[i], uint64(i))
}

if err := env.Update(func(txn *Txn) (err error) {
db, err = txn.OpenRoot(0)
if err != nil {
return err
}
for _, k := range keys {
err = txn.Put(db, k, k, 0)
if err != nil {
return err
}
}
return nil
}); err != nil {
b.Errorf("dbi: %v", err)
return
}

if err := env.View(func(txn *Txn) (err error) {
c, err := txn.OpenCursor(db)
if err != nil {
return err
}
b.ResetTimer()
for i := 0; i < b.N; i++ {
_, _, err := c.Get(k, nil, Set)
if err != nil {
return err
}
}
return nil
}); err != nil {
b.Errorf("put: %v", err)
}
}

func BenchmarkCursor_Set_Sequence(b *testing.B) {
env, _ := setup(b)

Expand Down

0 comments on commit dda3575

Please sign in to comment.