tjhann / imageformats

Image loading/saving

Home Page:https://code.dlang.org/packages/imageformats

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JPEG decoder should be faster

opened this issue · comments

commented

Some load-time measures on a 1836 x 3264 JPEG. Median of 11 image loads (separate measures for in-memory or files). Compiled with dub build -b release-nobounds, Mac OS 10.10.4.

|                 |         32-bit             |            64-bit          |
|  DMD 2.068      | 1667 ms (1503 ms decoding) | 1321 ms (1267 ms decoding) |
|  LDC 0.15.2-b2  | 733 ms (467 ms decoding)   | 547 ms (375 ms decoding)   |

commented

Much time is passed in upsample_rgb because of unneeded floor operations. Replaced with faster int casts since the argument is never negative.

New timings with #11 (only in-memory decoding)

|                 | 32-bit | 64-bit |
|  DMD 2.068      | 915 ms | 554 ms |
|  LDC 0.15.2-b2  | 286 ms | 274 ms |

So a ~40% improvement.

commented

Hi there, merges + tag would be nice since I'd like to drop my non-working, non-idiomatic stb_image translation. imageformats looks very nice.

Reworked the resampling, closing this. Doesn't mean more optimization can't be done :)

commented

Yay! This make a nice 36% reduction of load time on one big image here with DMD 32-bit.