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 Object Creation #5

Open
Philip-Trettner opened this issue Jan 18, 2017 · 0 comments
Open

Unnecessary Object Creation #5

Philip-Trettner opened this issue Jan 18, 2017 · 0 comments

Comments

@Philip-Trettner
Copy link
Owner

All optimizations of the following form:

public static vec4 Sub(vec4 lhs, vec4 rhs) => new vec4(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z, lhs.w - rhs.w);

to

public static vec4 Sub(vec4 lhs, vec4 rhs) {
    lhs.x -= rhs.x;
    lhs.y -= rhs.y;
    lhs.z -= rhs.z;
    lhs.w -= rhs.w;
    return lhs;
}

To optimize for stack usage and less object creation.

@Philip-Trettner Philip-Trettner changed the title Performance Potential Unnecessary Object Creation Jan 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant