MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / BenchmarkGetN

Function BenchmarkGetN

consistent/consistent_test.go:877–889  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

875}
876
877func BenchmarkGetN(b *testing.B) {
878 kms.Unittest = true
879 utils.RemoveAll(testStorePath + "*")
880 kms.ResetBucket()
881
882 x, _ := InitConsistent(testStorePath, new(KMSStorage), false)
883 defer utils.RemoveAll(testStorePath + "*")
884 x.Add(NewNodeFromString("nothing"))
885 b.ResetTimer()
886 for i := 0; i < b.N; i++ {
887 x.GetNeighbors("nothing", 3)
888 }
889}
890
891func BenchmarkGetNLarge(b *testing.B) {
892 kms.Unittest = true

Callers

nothing calls this directly

Calls 6

RemoveAllFunction · 0.92
ResetBucketFunction · 0.92
InitConsistentFunction · 0.85
NewNodeFromStringFunction · 0.85
GetNeighborsMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected