Disable nimPng and stb image.

This commit is contained in:
treeform 2022-07-10 11:12:45 -07:00
parent 3abdfb8495
commit 8bc78c939b
2 changed files with 45 additions and 42 deletions

View file

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

View file

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