MCPcopy Create free account
hub / github.com/bobg/hashsplit / BenchmarkTree

Function BenchmarkTree

hashsplit_test.go:155–166  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

153}
154
155func BenchmarkTree(b *testing.B) {
156 text, err := os.ReadFile("testdata/commonsense.txt")
157 if err != nil {
158 b.Fatal(err)
159 }
160
161 b.ResetTimer()
162
163 for i := 0; i < b.N; i++ {
164 _, _ = buildTree(text)
165 }
166}
167
168func buildTree(text []byte) (*TreeNode, error) {
169 split, errptr := Split(bytes.NewReader(text))

Callers

nothing calls this directly

Calls 1

buildTreeFunction · 0.85

Tested by

no test coverage detected