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

Struct-valued custom enumerator for pixel offsets #1171

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Lehonti
Copy link
Contributor

@Lehonti Lehonti commented Nov 30, 2024

I think one shouldn't have to allocate on the heap in order to enumerate the pixel coordinates and offsets.

To be consumed by a foreach loop an object doesn't need to implement IEnumerable<T>, but only expose public methods with the corresponding names and signatures.

It is my understanding that this new approach would prevent heap allocations except when the object is explicitly used as an IEnumerable<T> (like in VoronoiDiagramEffect through an invocation of Select).

@Lehonti Lehonti marked this pull request as ready for review November 30, 2024 03:03
@cameronwhite
Copy link
Member

Could you try running the effect benchmarks to see if there's a notable difference with this change? If so I'm okay with it, but otherwise the original implementation is much simpler

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.

2 participants