示例#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)
}
示例#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)
	})
}
示例#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
		})
	}
}
示例#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
}
示例#5
0
func benchmarkGet(b *testing.B, image *imageserver.Image, parallelism int) {
	cache := newTestCache(b)
	defer cache.Close()
	cachetest.BenchmarkGet(b, cache, 16, image)
}
示例#6
0
func benchmarkGet(b *testing.B, image *imageserver.Image) {
	cache := newTestCache()
	cachetest.BenchmarkGet(b, cache, 1, image) // more parallelism change nothing
}