MCPcopy
hub / github.com/syncthing/syncthing / benchmarkIndex

Function benchmarkIndex

lib/model/model_test.go:165–177  ·  view source on GitHub ↗
(b *testing.B, nfiles int)

Source from the content-addressed store, hash-verified

163}
164
165func benchmarkIndex(b *testing.B, nfiles int) {
166 m, _, fcfg := setupModelWithConnection(b)
167 defer cleanupModelAndRemoveDir(m, fcfg.Filesystem().URI())
168
169 files := genFiles(nfiles)
170 must(b, m.Index(device1Conn, &protocol.Index{Folder: fcfg.ID, Files: files}))
171
172 b.ResetTimer()
173 for i := 0; i < b.N; i++ {
174 must(b, m.Index(device1Conn, &protocol.Index{Folder: fcfg.ID, Files: files}))
175 }
176 b.ReportAllocs()
177}
178
179func BenchmarkIndexUpdate_10000_10000(b *testing.B) {
180 benchmarkIndexUpdate(b, 10000, 10000)

Callers 2

BenchmarkIndex_10000Function · 0.85
BenchmarkIndex_100Function · 0.85

Calls 7

setupModelWithConnectionFunction · 0.85
cleanupModelAndRemoveDirFunction · 0.85
genFilesFunction · 0.85
mustFunction · 0.85
FilesystemMethod · 0.80
URIMethod · 0.65
IndexMethod · 0.65

Tested by

no test coverage detected