memdb_test.go 381 B

1234567891011121314151617181920212223
  1. package needle_map
  2. import (
  3. "testing"
  4. "github.com/chrislusf/seaweedfs/weed/storage/types"
  5. )
  6. func BenchmarkMemDb(b *testing.B) {
  7. b.ReportAllocs()
  8. for i := 0; i < b.N; i++ {
  9. nm := NewMemDb()
  10. nid := types.NeedleId(345)
  11. offset := types.Offset{
  12. OffsetHigher: types.OffsetHigher{},
  13. OffsetLower: types.OffsetLower{},
  14. }
  15. nm.Set(nid, offset, 324)
  16. nm.Close()
  17. }
  18. }