From a4e3d7068be8aa0f20e95b4b78dbb398e86abe83 Mon Sep 17 00:00:00 2001 From: Sanjit Bhat Date: Mon, 2 Dec 2024 12:33:38 -0500 Subject: [PATCH] push basic benchmark file --- kt/kt_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 kt/kt_test.go diff --git a/kt/kt_test.go b/kt/kt_test.go new file mode 100644 index 0000000..3b5cfc5 --- /dev/null +++ b/kt/kt_test.go @@ -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++ + } +}