Skip to content

Unnecessary heap allocation in mandelbrot/2.cs #386

Open
@Ttxman

Description

@Ttxman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions