Fix bench jpeg and make blends slower.

This commit is contained in:
treeform 2022-07-09 17:37:23 -07:00
parent 25964566cf
commit 84e86a8c30
2 changed files with 10 additions and 5 deletions

View file

@ -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() =

View file

@ -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),