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

Unnecessary heap allocation in mandelbrot/2.cs #386

Open
Ttxman opened this issue Apr 19, 2023 · 0 comments
Open

Unnecessary heap allocation in mandelbrot/2.cs #386

Ttxman opened this issue Apr 19, 2023 · 0 comments

Comments

@Ttxman
Copy link

Ttxman commented Apr 19, 2023

Why is this here?

var ci = new Vector<double>(new[] { civ, civ, civ, civ });

Rest of the code assumes 256bit (4 doubles) vectors and
So this is equivalent of just calling

 var ci = new Vector<double>(civ); 

Just with heap allocation of new array each call :/

Same constructor overload new Vector<double>(0); (I would use Vector<double>.Zero but the performance impact will be negligible) is used in the zeroing of all other vectors so the heap allocation seems odd.

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