MCPcopy
hub / github.com/syncthing/syncthing / BenchmarkJobQueueBump

Function BenchmarkJobQueueBump

lib/model/queue_test.go:166–181  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

164}
165
166func BenchmarkJobQueueBump(b *testing.B) {
167 files := genFiles(10000)
168
169 q := newJobQueue()
170 for _, f := range files {
171 q.Push(f.Name, 0, time.Time{})
172 }
173
174 rng := rand.New(rand.NewSource(int64(b.N)))
175
176 b.ResetTimer()
177 for i := 0; i < b.N; i++ {
178 r := rng.Intn(len(files))
179 q.BringToFront(files[r].Name)
180 }
181}
182
183func BenchmarkJobQueuePushPopDone10k(b *testing.B) {
184 files := genFiles(10000)

Callers

nothing calls this directly

Calls 5

genFilesFunction · 0.85
newJobQueueFunction · 0.85
NewMethod · 0.65
BringToFrontMethod · 0.65
PushMethod · 0.45

Tested by

no test coverage detected