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

Function BenchmarkCycleLarge

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

Source from the content-addressed store, hash-verified

828}
829
830func BenchmarkCycleLarge(b *testing.B) {
831 kms.Unittest = true
832 utils.RemoveAll(testStorePath + "*")
833 kms.ResetBucket()
834
835 x, _ := InitConsistent(testStorePath, new(KMSStorage), false)
836 defer utils.RemoveAll(testStorePath + "*")
837 for i := 0; i < 10; i++ {
838 x.Add(NewNodeFromString("start" + strconv.Itoa(i)))
839 }
840 b.ResetTimer()
841 for i := 0; i < b.N; i++ {
842 x.Add(NewNodeFromString("foo" + strconv.Itoa(i)))
843 x.Remove(NodeID("foo" + strconv.Itoa(i)))
844 }
845}
846
847func BenchmarkGet(b *testing.B) {
848 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