(b *testing.B, nfiles int)
| 163 | } |
| 164 | |
| 165 | func 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 | |
| 179 | func BenchmarkIndexUpdate_10000_10000(b *testing.B) { |
| 180 | benchmarkIndexUpdate(b, 10000, 10000) |
no test coverage detected