Skip to content

Commit

Permalink
rotom v2
Browse files Browse the repository at this point in the history
  • Loading branch information
xgzlucario committed Jun 2, 2024
1 parent b19d4b5 commit 8971f9a
Show file tree
Hide file tree
Showing 27 changed files with 184 additions and 2,604 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tmp-*
coverage.*
rotom
*.aof
File renamed without changes.
78 changes: 0 additions & 78 deletions batch.go

This file was deleted.

125 changes: 0 additions & 125 deletions batch_test.go

This file was deleted.

43 changes: 43 additions & 0 deletions bench_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package main

import (
"testing"

"github.com/cockroachdb/swiss"
)

func BenchmarkMap(b *testing.B) {
const N = 100

b.Run("stdmap/set", func(b *testing.B) {
m := make(map[int]int, N)
for i := 0; i < b.N; i++ {
m[i%N] = i % N
}
})
b.Run("swiss/set", func(b *testing.B) {
m := swiss.New[int, int](N)
for i := 0; i < b.N; i++ {
m.Put(i%N, i%N)
}
})

b.Run("stdmap/get", func(b *testing.B) {
m := make(map[int]int, N)
for i := 0; i < N; i++ {
m[i] = i
}
for i := 0; i < b.N; i++ {
_ = m[i%N]
}
})
b.Run("swiss/get", func(b *testing.B) {
m := swiss.New[int, int](N)
for i := 0; i < N; i++ {
m.Put(i, i)
}
for i := 0; i < b.N; i++ {
m.Get(i % N)
}
})
}
107 changes: 0 additions & 107 deletions codeman/codec.go

This file was deleted.

Loading

0 comments on commit 8971f9a

Please sign in to comment.