Closed odeke-em closed 9 years ago
Based on findings in #20, it seems to me like the only case where memoization would yield any performance benefit is for large n, and when the image is composed primarily of flat colors (i.e. many pixels of the same color). This sounds like it would be a per image setting, so I'm not sure if it makes sense to make this a compile-time change.
What if it were an optional parameter passed to the function?
Great thought, sounds like a plan. I'll spin up a fresh address for this.
Actually @indragiek will push up a fresh PR to address the common case.
Pass in compiler macro definition 'MEMOIZE' to make use of memoization only when required since in some cases it is slower than the unmemoized version.