Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Wuffs/PNG decoder to qoibench #11

Closed
wants to merge 1 commit into from

Conversation

nigeltao
Copy link

Wuffs/PNG can decode roughly 2.0x - 2.5x faster than libpng. See:
https://github.com/google/wuffs
https://nigeltao.github.io/blog/2021/fastest-safest-png-decoder.html

On a x86_64 Broadwell desktop CPU:

images/kodak
decode ms encode ms decode mpps encode mpps size kb
libpng: 8.5 153.5 42.91 2.37 662
stbi: 9.1 86.7 39.79 4.18 904
wuffs: 4.0 n/a 89.94 n/a n/a
qoi: 3.5 4.0 103.95 90.02 712

images/misc
decode ms encode ms decode mpps encode mpps size kb
libpng: 7.9 71.4 69.20 7.64 239
stbi: 6.2 58.3 87.85 9.36 355
wuffs: 2.9 n/a 185.74 n/a n/a
qoi: 2.2 2.1 253.01 258.79 322

images/screenshots
decode ms encode ms decode mpps encode mpps size kb
libpng: 48.9 510.8 145.96 13.96 1923
stbi: 42.8 577.7 166.60 12.35 2445
wuffs: 35.0 n/a 203.53 n/a n/a
qoi: 24.5 18.2 291.44 392.67 2237

images/textures
decode ms encode ms decode mpps encode mpps size kb
libpng: 4.0 57.0 32.86 2.30 278
stbi: 4.3 34.3 30.63 3.82 403
wuffs: 2.3 n/a 58.17 n/a n/a
qoi: 1.2 1.6 107.12 82.38 295

images/wallpaper
decode ms encode ms decode mpps encode mpps size kb
libpng: 169.1 2458.0 51.95 3.57 8648
stbi: 200.0 1470.7 43.92 5.97 12468
wuffs: 94.9 n/a 92.58 n/a n/a
qoi: 73.2 72.9 120.01 120.60 9981

Wuffs/PNG can decode roughly 2.0x - 2.5x faster than libpng. See:
https://github.com/google/wuffs
https://nigeltao.github.io/blog/2021/fastest-safest-png-decoder.html

On a x86_64 Broadwell desktop CPU:

images/kodak
        decode ms   encode ms   decode mpps   encode mpps   size kb
libpng:       8.6       156.6         42.25          2.32       662
stbi:         9.3        88.4         39.15          4.10       904
wuffs:        4.4         n/a         82.98           n/a       n/a
qoi:          3.5         4.1        102.71         88.45       712

images/misc
        decode ms   encode ms   decode mpps   encode mpps   size kb
libpng:       8.0        72.8         67.98          7.49       239
stbi:         6.3        59.8         85.90          9.12       355
wuffs:        3.1         n/a        178.21           n/a       n/a
qoi:          2.2         2.1        247.51        260.54       322

images/screenshots
        decode ms   encode ms   decode mpps   encode mpps   size kb
libpng:      50.3       518.5        141.76         13.76      1923
stbi:        46.6       587.5        152.92         12.14      2445
wuffs:       38.7         n/a        184.35           n/a       n/a
qoi:         25.6        18.5        278.57        384.73      2237

images/textures
        decode ms   encode ms   decode mpps   encode mpps   size kb
libpng:       2.9        38.1         44.37          3.35       160
stbi:         2.7        21.9         46.91          5.82       228
wuffs:        1.4         n/a         88.32           n/a       n/a
qoi:          0.9         1.0        140.43        126.89       181

images/wallpaper
        decode ms   encode ms   decode mpps   encode mpps   size kb
libpng:     177.9      2508.4         49.40          3.50      8648
stbi:       214.0      1501.8         41.07          5.85     12468
wuffs:      111.0         n/a         79.19           n/a       n/a
qoi:         79.6        74.9        110.34        117.31      9981
@phoboslab
Copy link
Owner

I'm closing this to clean up a little.

libpng and stb_image were included in the benchmark as the "popular choice" libraries at the time. There's now other PNG implementations that should be even faster (eg. https://github.com/richgel999/fpng), but I'm not interested in maintaining a benchmark for any of them.

@phoboslab phoboslab closed this Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants