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

macro if guard for Memoization of labValue calculations #19

Closed
wants to merge 2 commits into from

Conversation

odeke-em
Copy link
Collaborator

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.

@indragiek
Copy link
Owner

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?

@odeke-em
Copy link
Collaborator Author

Great thought, sounds like a plan. I'll spin up a fresh address for this.

@odeke-em
Copy link
Collaborator Author

Actually @indragiek will push up a fresh PR to address the common case.

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