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 the QuadTreeRect struct properties not computed #1

Closed
sdcb opened this issue Oct 29, 2017 · 2 comments
Closed

Why the QuadTreeRect struct properties not computed #1

sdcb opened this issue Oct 29, 2017 · 2 comments

Comments

@sdcb
Copy link

sdcb commented Oct 29, 2017

I think those MidX, MidY, Top, Bottom, Left, Right, _halfWidth, _halfHeight should be computed property such as:

public readonly double Top => X;

This would save much memory and I think that may increase performance because of much less CPU cache invalidation.

@leonidovia
Copy link
Owner

sdcb, thanks for your message. Maybe you're right. I'll do a performance comparison for both versions.

@leonidovia
Copy link
Owner

I ran a performance test and I did not notice a significant difference. So I'll choose your version to save memory. Thank you for your advice.

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

2 participants