pixie/tests/benchmark_png.nim
Ryan Oldenburg 79e9ee7cd4 png
2020-11-20 20:21:27 -06:00

23 lines
483 B
Nim

import pixie/fileformats/png, stb_image/read as stbi, fidget/opengl/perf, nimPNG
let data = readFile("tests/data/lenna.png")
timeIt "pixie":
for i in 0 ..< 100:
discard decodePng(cast[seq[uint8]](data))
timeIt "nimPNG":
for i in 0 ..< 100:
discard decodePNG32(data)
timeIt "stb_image":
for i in 0 ..< 100:
var width, height, channels: int
discard loadFromMemory(
cast[seq[byte]](data),
width,
height,
channels,
stbi.RGBA
)