From 8bc78c939bc48d39c90d812c7c9643717a584c67 Mon Sep 17 00:00:00 2001 From: treeform Date: Sun, 10 Jul 2022 11:12:45 -0700 Subject: [PATCH] Disable nimPng and stb image. --- tests/bench_jpeg.nim | 29 +++++++++++----------- tests/bench_png.nim | 58 +++++++++++++++++++++++--------------------- 2 files changed, 45 insertions(+), 42 deletions(-) diff --git a/tests/bench_jpeg.nim b/tests/bench_jpeg.nim index 284d7f5..99ab2b9 100644 --- a/tests/bench_jpeg.nim +++ b/tests/bench_jpeg.nim @@ -1,4 +1,4 @@ -import benchy, pixie/fileformats/jpeg, jpegsuite, os, stb_image/read as stbi +import benchy, pixie/fileformats/jpeg, jpegsuite, os for file in jpegSuiteFiles: let data = readFile(file) @@ -6,17 +6,18 @@ for file in jpegSuiteFiles: timeIt "pixie " & file.splitPath.tail & " decode": discard decodeJpeg(data) -block: - for file in jpegSuiteFiles: - let data = readFile(file) - var name = file.splitPath.tail +# import stb_image/read as stbi +# block: +# for file in jpegSuiteFiles: +# let data = readFile(file) +# var name = file.splitPath.tail - timeIt "stb " & file.splitPath.tail & " decode": - var width, height, channels: int - discard loadFromMemory( - cast[seq[byte]](data), - width, - height, - channels, - stbi.RGBA - ) +# timeIt "stb " & file.splitPath.tail & " decode": +# var width, height, channels: int +# discard loadFromMemory( +# cast[seq[byte]](data), +# width, +# height, +# channels, +# stbi.RGBA +# ) diff --git a/tests/bench_png.nim b/tests/bench_png.nim index 99d2609..2439118 100644 --- a/tests/bench_png.nim +++ b/tests/bench_png.nim @@ -1,5 +1,4 @@ -import benchy, nimPNG, pixie/fileformats/png, stb_image/read as stbi, - stb_image/write as stbr +import benchy, pixie/fileformats/png let filePath = "tests/fileformats/png/lenna.png" @@ -22,37 +21,40 @@ block: timeIt "pixie encode + alpha": discard encodePng(decodedImage) -block: - timeIt "nimPNG decode": - discard decodePNG32(data) +# import nimPNG +# block: +# timeIt "nimPNG decode": +# discard decodePNG32(data) - let decoded = decodePNG32(data) - timeIt "nimPNG encode": - discard encodePNG32(decoded.data, decoded.width, decoded.height) +# let decoded = decodePNG32(data) +# timeIt "nimPNG encode": +# discard encodePNG32(decoded.data, decoded.width, decoded.height) -block: - timeIt "stb_image decode": - var width, height, channels: int - discard loadFromMemory( - cast[seq[byte]](data), - width, - height, - channels, - stbi.RGBA - ) +# import stb_image/read as stbi, stb_image/write as stbr +# block: +# timeIt "stb_image decode": +# var width, height, channels: int +# discard loadFromMemory( +# cast[seq[byte]](data), +# width, +# height, +# channels, +# stbi.RGBA +# ) - var width, height, channels: int - let decoded = loadFromMemory( - cast[seq[byte]](data), - width, - height, - channels, - stbi.RGBA - ) +# var width, height, channels: int +# let decoded = loadFromMemory( +# cast[seq[byte]](data), +# width, +# height, +# channels, +# stbi.RGBA +# ) - timeIt "stb_image encode": - discard writePNG(width, height, channels, decoded).len +# timeIt "stb_image encode": +# discard writePNG(width, height, channels, decoded).len +# import cairo # block: # timeIt "cairo decode": # discard imageSurfaceCreateFromPng(filePath.cstring)