MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / BenchmarkTrie_Remove_and_Compact

Function BenchmarkTrie_Remove_and_Compact

structure/trie/trie_bench_test.go:68–81  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

66}
67
68func BenchmarkTrie_Remove_and_Compact(b *testing.B) {
69 insert := make([]string, 3000)
70 for i := 0; i < len(insert); i++ {
71 insert[i] = fmt.Sprintf("%f", rand.Float64())
72 }
73 n := NewNode()
74 n.Insert(insert...)
75
76 b.ResetTimer()
77 for i := 0; i < b.N; i++ {
78 n.Remove(insert[i%3000])
79 n.Compact()
80 }
81}

Callers

nothing calls this directly

Calls 4

InsertMethod · 0.95
RemoveMethod · 0.95
CompactMethod · 0.95
NewNodeFunction · 0.70

Tested by

no test coverage detected