-
-
Notifications
You must be signed in to change notification settings - Fork 956
Cache calculation of bounding boxes with transforms #3287
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
base: master
Are you sure you want to change the base?
Conversation
std::mem::drop(read); | ||
let mut write = self.bounding_box_cache.write().unwrap(); | ||
if write.len() >= 10 { | ||
write.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to clear the cache completely here?
Did you do performance tests on the number of max cache entries, could be interesting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using a flush when full replacement strategy which gives the same theoretical guarantees as something like an lru but is significantly easier to implement. If we wanted to improve performance, we could try to remove any scaling factors since they don't affect the outcome and to use fingerprinting to improve the search speed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, implemented the optimizations
Performance Benchmark Results
|
Improves performance for panning etc.