MCPcopy
hub / github.com/syncthing/syncthing / benchmarkTree

Function benchmarkTree

lib/model/model_test.go:2078–2092  ·  view source on GitHub ↗
(b *testing.B, n1, n2 int)

Source from the content-addressed store, hash-verified

2076}
2077
2078func benchmarkTree(b *testing.B, n1, n2 int) {
2079 m, _, fcfg := setupModelWithConnection(b)
2080 defer cleanupModelAndRemoveDir(m, fcfg.Filesystem().URI())
2081
2082 m.ScanFolder(fcfg.ID)
2083 files := genDeepFiles(n1, n2)
2084
2085 must(b, m.Index(device1Conn, &protocol.Index{Folder: fcfg.ID, Files: files}))
2086
2087 b.ResetTimer()
2088 for i := 0; i < b.N; i++ {
2089 m.GlobalDirectoryTree(fcfg.ID, "", -1, false)
2090 }
2091 b.ReportAllocs()
2092}
2093
2094func TestIssue3028(t *testing.T) {
2095 w, cancel := newConfigWrapper(defaultCfg)

Callers 3

BenchmarkTree_10000_50Function · 0.85
BenchmarkTree_100_50Function · 0.85
BenchmarkTree_100_10Function · 0.85

Calls 9

setupModelWithConnectionFunction · 0.85
cleanupModelAndRemoveDirFunction · 0.85
genDeepFilesFunction · 0.85
mustFunction · 0.85
FilesystemMethod · 0.80
URIMethod · 0.65
ScanFolderMethod · 0.65
IndexMethod · 0.65
GlobalDirectoryTreeMethod · 0.65

Tested by

no test coverage detected