More benchy!
This commit is contained in:
parent
4aa5f594b4
commit
66c2f08cdb
2 changed files with 16 additions and 23 deletions
|
@ -1,7 +1,6 @@
|
|||
import pixie/fileformats/jpg, fidget/opengl/perf
|
||||
import pixie/fileformats/jpg, benchy
|
||||
|
||||
let data = readFile("tests/images/jpg/jpeg420exif.jpg")
|
||||
|
||||
timeIt "pixie decode":
|
||||
for i in 0 ..< 20:
|
||||
discard decodeJpg(cast[seq[uint8]](data))
|
||||
|
|
|
@ -1,30 +1,25 @@
|
|||
import pixie/fileformats/png, stb_image/read as stbi, stb_image/write as stbr,
|
||||
fidget/opengl/perf, nimPNG
|
||||
benchy, nimPNG
|
||||
|
||||
let data = readFile("tests/images/png/lenna.png")
|
||||
|
||||
timeIt "pixie decode":
|
||||
for i in 0 ..< 100:
|
||||
discard decodePng(cast[seq[uint8]](data))
|
||||
keep decodePng(cast[seq[uint8]](data))
|
||||
|
||||
timeIt "pixie encode":
|
||||
let decoded = decodePng(cast[seq[uint8]](data))
|
||||
for i in 0 ..< 1:
|
||||
discard encodePng(decoded).len
|
||||
keep encodePng(decoded).len
|
||||
|
||||
timeIt "nimPNG decode":
|
||||
for i in 0 ..< 100:
|
||||
discard decodePNG32(data)
|
||||
keep decodePNG32(data)
|
||||
|
||||
timeIt "nimPNG encode":
|
||||
let decoded = decodePNG32(data)
|
||||
for i in 0 ..< 100:
|
||||
discard encodePNG32(decoded.data, decoded.width, decoded.height).pixels.len
|
||||
keep encodePNG32(decoded.data, decoded.width, decoded.height).pixels.len
|
||||
|
||||
timeIt "stb_image decode":
|
||||
for i in 0 ..< 100:
|
||||
var width, height, channels: int
|
||||
discard loadFromMemory(
|
||||
keep loadFromMemory(
|
||||
cast[seq[byte]](data),
|
||||
width,
|
||||
height,
|
||||
|
@ -41,5 +36,4 @@ timeIt "stb_image encode":
|
|||
channels,
|
||||
stbi.RGBA
|
||||
)
|
||||
for i in 0 ..< 100:
|
||||
discard writePNG(width, height, channels, decoded).len
|
||||
keep writePNG(width, height, channels, decoded).len
|
||||
|
|
Loading…
Reference in a new issue