Sfoglia il codice sorgente

Add benchmarks for Lanczos3Lut to compare it with Lanczos3 performance.

jst 12 anni fa
parent
commit
252ccc84a2
1 ha cambiato i file con 9 aggiunte e 1 eliminazioni
  1. 9 1
      resize_test.go

+ 9 - 1
resize_test.go

@@ -53,7 +53,7 @@ func Test_CorrectResize(t *testing.T) {
 	}
 }
 
-func Benchmark_BigResize(b *testing.B) {
+func Benchmark_BigResizeLanczos3(b *testing.B) {
 	var m image.Image
 	for i := 0; i < b.N; i++ {
 		m = Resize(1000, 1000, img, Lanczos3)
@@ -61,6 +61,14 @@ func Benchmark_BigResize(b *testing.B) {
 	m.At(0, 0)
 }
 
+func Benchmark_BigResizeLanczos3Lut(b *testing.B) {
+	var m image.Image
+	for i := 0; i < b.N; i++ {
+		m = Resize(1000, 1000, img, Lanczos3Lut)
+	}
+	m.At(0, 0)
+}
+
 func Benchmark_Reduction(b *testing.B) {
 	largeImg := image.NewRGBA(image.Rect(0, 0, 1000, 1000))