99designs / colorific

Automatic color palette detection
ISC License
700 stars 55 forks source link

Speed-related optimizations #24

Closed dset0x closed 9 years ago

dset0x commented 9 years ago

Note the change in the structure of requirements due to the addition of the dependency on backports.functools_lru_cache for python < 3.2.

The biggest performance improvement comes from the use of im.getcolors however.

Overall, processing time has been cut in half.

Before and after times of 23 images, of around 2MP each:

41.48s user 0.17s system 99% cpu 41.725 total
19.74s user 0.23s system 99% cpu 20.105 total

Before and after times of 64 images, of around 0.3MP each:

27.45s user 0.02s system 99% cpu 27.521 total
15.33s user 0.04s system 98% cpu 15.609 total
larsyencken commented 9 years ago

Good work! I'll see that this gets merged, a little admin to do on my side first.

dhotson commented 9 years ago

Sorry about the wait. Thanks for the PR! :)

dset0x commented 9 years ago

Awesome, thanks for merging this. More to come.