Commit f7fc25ed authored by Nigel Tao's avatar Nigel Tao
Browse files

image/gif: add more writer benchmarks

The two existing benchmarks encode randomized pixels, which isn't very
representative. The two new benchmarks encode a PNG photo as a GIF.

Also rename the benchmarks for consistency.

Also fix the bytes-per-op measure for paletted images, which are 1 (not
4) bytes per pixel.

Also simplify BenchmarkEncodeRandomPaletted (formerly just called
BenchmarkEncode). It doesn't need to generate a random palette (and the
GIF encoder largely doesn't care about the palette's RGBA values).
Use palette.Plan9 instead, a pre-existing 256-element color palette.

Change-Id: I10a6ea4e9590bb0d9f76e8cc0f4a88d43b1d650d
Reviewed-on: https://go-review.googlesource.com/c/go/+/248218


Reviewed-by: default avatarDavid Symonds <dsymonds@golang.org>
parent c810c6db
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment