MCPcopy Index your code
hub / github.com/coder/coder / buildIndex

Function buildIndex

agent/filefinder/bench_test.go:79–86  ·  view source on GitHub ↗

buildIndex walks root and returns a populated Index, the same way Engine.AddRoot does but without starting a watcher.

(t testing.TB, root string)

Source from the content-addressed store, hash-verified

77// buildIndex walks root and returns a populated Index, the same
78// way Engine.AddRoot does but without starting a watcher.
79func buildIndex(t testing.TB, root string) *filefinder.Index {
80 t.Helper()
81 absRoot, err := filepath.Abs(root)
82 require.NoError(t, err)
83 idx, err := filefinder.BuildTestIndex(absRoot)
84 require.NoError(t, err)
85 return idx
86}
87
88func BenchmarkBuildIndex(b *testing.B) {
89 scales := []struct {

Callers 5

BenchmarkBuildIndexFunction · 0.85
BenchmarkSearch_ByScaleFunction · 0.85
BenchmarkDeltaUpdateFunction · 0.85
BenchmarkMemoryProfileFunction · 0.85

Calls 2

BuildTestIndexFunction · 0.92
HelperMethod · 0.65

Tested by

no test coverage detected