Ejemplo n.º 1
0
func benchmarkGet(b *testing.B, image *imageserver.Image, parallelism int) {
	cache := newTestCache(b)
	defer func() {
		_ = cache.Pool.Close()
	}()
	cachetest.BenchmarkGet(b, cache, parallelism, image)
}
Ejemplo n.º 2
0
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)
	})
}
Ejemplo n.º 3
0
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
		})
	}
}
Ejemplo n.º 4
0
func benchmarkGet(b *testing.B, image *imageserver.Image) {
	cache := newTestCache(b)
	cachetest.BenchmarkGet(b, cache, 1, image) // memcached is unstable with more parallelism
}
Ejemplo n.º 5
0
func benchmarkGet(b *testing.B, image *imageserver.Image, parallelism int) {
	cache := newTestCache(b)
	defer cache.Close()
	cachetest.BenchmarkGet(b, cache, 16, image)
}
Ejemplo n.º 6
0
func benchmarkGet(b *testing.B, image *imageserver.Image) {
	cache := newTestCache()
	cachetest.BenchmarkGet(b, cache, 1, image) // more parallelism change nothing
}