func benchmarkGet(b *testing.B, image *imageserver.Image, parallelism int) { cache := newTestCache(b) defer func() { _ = cache.Pool.Close() }() cachetest.BenchmarkGet(b, cache, parallelism, image) }
func benchmarkGet(b *testing.B, name string, image *imageserver.Image, parallelism int) { b.Run(name, func(b *testing.B) { cch := newTestCache(b) defer func() { _ = cch.Pool.Close() }() cachetest.BenchmarkGet(b, cch, parallelism, image) }) }
func BenchmarkGet(b *testing.B) { for _, tc := range []struct { name string im *imageserver.Image }{ {"Small", testdata.Small}, {"Medium", testdata.Medium}, {"Large", testdata.Large}, } { b.Run(tc.name, func(b *testing.B) { cch := newTestCache(b) cachetest.BenchmarkGet(b, cch, 1, tc.im) // memcached is unstable with more parallelism }) } }
func benchmarkGet(b *testing.B, image *imageserver.Image) { cache := newTestCache(b) cachetest.BenchmarkGet(b, cache, 1, image) // memcached is unstable with more parallelism }
func benchmarkGet(b *testing.B, image *imageserver.Image, parallelism int) { cache := newTestCache(b) defer cache.Close() cachetest.BenchmarkGet(b, cache, 16, image) }
func benchmarkGet(b *testing.B, image *imageserver.Image) { cache := newTestCache() cachetest.BenchmarkGet(b, cache, 1, image) // more parallelism change nothing }