MCPcopy
hub / github.com/syncthing/syncthing / benchmarkIndexUpdate

Function benchmarkIndexUpdate

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

Source from the content-addressed store, hash-verified

189}
190
191func benchmarkIndexUpdate(b *testing.B, nfiles, nufiles int) {
192 m, _, fcfg := setupModelWithConnection(b)
193 defer cleanupModelAndRemoveDir(m, fcfg.Filesystem().URI())
194
195 files := genFiles(nfiles)
196 ufiles := genFiles(nufiles)
197
198 must(b, m.Index(device1Conn, &protocol.Index{Folder: fcfg.ID, Files: files}))
199
200 b.ResetTimer()
201 for i := 0; i < b.N; i++ {
202 must(b, m.IndexUpdate(device1Conn, &protocol.IndexUpdate{Folder: fcfg.ID, Files: ufiles}))
203 }
204 b.ReportAllocs()
205}
206
207func BenchmarkRequestOut(b *testing.B) {
208 m := setupModel(b, defaultCfgWrapper)

Calls 8

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

Tested by

no test coverage detected