This project is read-only.
1
Vote

Simple performance improvement

description

While performance profiling I found an easy adjustment to WuQuantizerBase.ProcessImagePixels that I wanted to pass along.

The repeated calls to the result.Height and result.Width properties within the method's for loops are expensive. Adjusting the method to simply get these values once at the top of the method (as in BuildHistogram) yielded a non-trivial performance speedup on my machine; +200ms savings when processing the topo.png sample image.

Thanks for the great project.

comments

mwrock wrote Aug 27, 2013 at 1:40 AM

Thats great! I'd gladly accept this pull request ;)

drewnoakes wrote Nov 29, 2013 at 10:18 PM

This is one of the many improvements I included in a pull request I just filed:

https://nquant.codeplex.com/SourceControl/network/forks/drewnoakes/nquant/contribution/5765