From 84e86a8c30790da609346afef155da9850166966 Mon Sep 17 00:00:00 2001 From: treeform Date: Sat, 9 Jul 2022 17:37:23 -0700 Subject: [PATCH] Fix bench jpeg and make blends slower. --- tests/bench_blends.nim | 4 ++-- tests/bench_jpeg.nim | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/bench_blends.nim b/tests/bench_blends.nim index 59befb7..d149f20 100644 --- a/tests/bench_blends.nim +++ b/tests/bench_blends.nim @@ -1,8 +1,8 @@ import benchy, chroma, pixie/blends, pixie/images, vmath let - backdrop = newImage(256, 256) - source = newImage(256, 256) + backdrop = newImage(512, 512) + source = newImage(512, 512) source.fill(rgba(100, 100, 100, 100)) template reset() = diff --git a/tests/bench_jpeg.nim b/tests/bench_jpeg.nim index 1d9d22d..c5e02dd 100644 --- a/tests/bench_jpeg.nim +++ b/tests/bench_jpeg.nim @@ -1,14 +1,19 @@ -import benchy, jpegsuite, pixie/fileformats/jpeg, stb_image/read as stbi, strformat +import benchy, jpegsuite, pixie/fileformats/jpeg, stb_image/read as stbi, + strformat, os for file in jpegSuiteFiles: let data = readFile(file) - timeIt &"pixie jpeg {(data.len div 1024)}k decode": + var name = file.splitPath.tail + name.setLen(min(name.len, 22)) + timeIt &"pixie {name} decode": discard decodeJpeg(data) block: for file in jpegSuiteFiles: let data = readFile(file) - timeIt &"stb_image jpeg {(data.len div 1024)}k decode": + var name = file.splitPath.tail + name.setLen(min(name.len, 22)) + timeIt &"stb {name} decode": var width, height, channels: int discard loadFromMemory( cast[seq[byte]](data),