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

Function BenchmarkGetTwoLarge

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

Source from the content-addressed store, hash-verified

919}
920
921func BenchmarkGetTwoLarge(b *testing.B) {
922 kms.Unittest = true
923 utils.RemoveAll(testStorePath + "*")
924 kms.ResetBucket()
925
926 x, _ := InitConsistent(testStorePath, new(KMSStorage), false)
927 defer utils.RemoveAll(testStorePath + "*")
928 for i := 0; i < 10; i++ {
929 x.Add(NewNodeFromString("start" + strconv.Itoa(i)))
930 }
931 b.ResetTimer()
932 for i := 0; i < b.N; i++ {
933 x.GetTwoNeighbors("nothing")
934 }
935}
936
937// from @edsrzf on github:.
938func TestAddCollision(t *testing.T) {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected