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

Rectangle efficiency #55

Closed
eadwright opened this issue Jun 30, 2016 · 1 comment
Closed

Rectangle efficiency #55

eadwright opened this issue Jun 30, 2016 · 1 comment

Comments

@eadwright
Copy link

I'm creating a large RTree with about 10M points. I wanted to use a flyweight pattern for the geometry, but alas I can't because 1) Util.mbr() creates a new Rectangle instance instead of using my geometry directly, and 2) Rectangle is a class not an interface with an implementation.

Why does this matter? The Rectangle instances take 600MB of my heap whereas the underlying (point) data takes less than 200MB. If Rectangle was an interface with a default implementation, and if Util could use it directly when the items collection only has 1 item in it, that could have a big performance gain in terms of memory. Done right, it wouldn't hurt speed in any significant way.

@eadwright
Copy link
Author

Fixed here: #56

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