Skip to content

Commit

Permalink
push basic benchmark file
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjit-bhat committed Dec 2, 2024
1 parent a39485e commit a4e3d70
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions kt/kt_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package kt

/*
benchmarking file. run with:
go test -bench=. -benchmem -benchtime=5s -cpuprofile=kt.prof ./kt
go tool pprof -http=localhost:4959 kt.test kt.prof
*/

import (
"testing"
)

func BenchmarkPut(b *testing.B) {
serv, _, _ := NewServer()

uid := uint64(0)
b.ResetTimer()
for range b.N {
serv.Put(uid, []byte("pk"))
uid++
}
}

0 comments on commit a4e3d70

Please sign in to comment.