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

Why collect the indices instead of drawing directly? #78

Closed
yakir12 opened this issue Dec 8, 2023 · 1 comment
Closed

Why collect the indices instead of drawing directly? #78

yakir12 opened this issue Dec 8, 2023 · 1 comment

Comments

@yakir12
Copy link
Contributor

yakir12 commented Dec 8, 2023

In

push!(ys, i)

we collect indices to later iterate over and draw (here). Why not skip the collection and just draw right there and then inside the loop?

It would avoid dynamically allocating x and y.

If there's no reason not I can PR and benchmark.

yakir12 added a commit to yakir12/ImageDraw.jl that referenced this issue Dec 8, 2023
@yakir12
Copy link
Contributor Author

yakir12 commented Dec 8, 2023

I went ahead and tried it out, looks pretty promising...

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

No branches or pull requests

1 participant