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

Function BenchmarkCycle

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

Source from the content-addressed store, hash-verified

813}
814
815func BenchmarkCycle(b *testing.B) {
816 kms.Unittest = true
817 utils.RemoveAll(testStorePath + "*")
818 kms.ResetBucket()
819
820 x, _ := InitConsistent(testStorePath, new(KMSStorage), false)
821 defer utils.RemoveAll(testStorePath + "*")
822 x.Add(NewNodeFromString("nothing"))
823 b.ResetTimer()
824 for i := 0; i < b.N; i++ {
825 x.Add(NewNodeFromString("foo" + strconv.Itoa(i)))
826 x.Remove(NodeID("foo" + strconv.Itoa(i)))
827 }
828}
829
830func BenchmarkCycleLarge(b *testing.B) {
831 kms.Unittest = true

Callers

nothing calls this directly

Calls 7

RemoveAllFunction · 0.92
ResetBucketFunction · 0.92
InitConsistentFunction · 0.85
NewNodeFromStringFunction · 0.85
NodeIDTypeAlias · 0.85
AddMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected