(b *testing.B, size int)
| 571 | func Benchmark_FreelistRelease10000K(b *testing.B) { benchmark_FreelistRelease(b, 10000000) } |
| 572 | |
| 573 | func benchmark_FreelistRelease(b *testing.B, size int) { |
| 574 | ids := randomPgids(size) |
| 575 | pending := randomPgids(len(ids) / 400) |
| 576 | b.ResetTimer() |
| 577 | for i := 0; i < b.N; i++ { |
| 578 | txp := &txPending{ids: pending} |
| 579 | f := newTestFreelist() |
| 580 | f.pendingPageIds()[1] = txp |
| 581 | f.Init(ids) |
| 582 | f.release(1) |
| 583 | } |
| 584 | } |
| 585 | |
| 586 | func randomPgids(n int) []common.Pgid { |
| 587 | pgids := make(common.Pgids, n) |
no test coverage detected