-
Notifications
You must be signed in to change notification settings - Fork 368
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
Refactor the 2D heuristic again #5166
Conversation
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 like the new recursive approach, it feels a lot simpler.
The key innovations here for robustness is clearly the store subscriber + automatic common-ancestor picking for the root
Doing some more testing & comment based fixups, then merging
impl MaxImageDimensions { | ||
/// Accesses the image dimension information for a given store | ||
pub fn access<T>( | ||
store_id: &StoreId, | ||
f: impl FnOnce(&IntMap<EntityPath, ImageDimensions>) -> T, | ||
) -> Option<T> { | ||
re_data_store::DataStore::with_subscriber_once( | ||
MaxImageDimensionSubscriber::subscription_handle(), | ||
move |subscriber: &MaxImageDimensionSubscriber| { | ||
subscriber.max_dimensions.get(store_id).map(|v| &v.0).map(f) | ||
}, | ||
) | ||
.flatten() | ||
} | ||
} |
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.
so annoying to ahve to repeat this boilerplate. Store subscriber needs a builtin layer for this...
dad4aee
to
015ba75
Compare
bf16bd5
to
da9a0d2
Compare
testing with opf --no-frames: spawn_heuristics for 2D costs me 0.13ms on release, so definitly got slower. Not amazing but don't care about this overhead right now. Interestingly we got quite heavy losses in property heuristics. whopping 1.2ms, but this wasn't this PR and it's not critical at this point |
### What - Builds on top of #5164 Adds a store subscriber for tracking the dimensions of image entities. Gets rid of the previous bucketing logic and replaces it with a new implementation that starts at the top of the subspace and incrementally splits when it finds conflicting image entities within the space. ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested the web demo (if applicable): * Using newly built examples: [app.rerun.io](https://app.rerun.io/pr/5166/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/5166/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [app.rerun.io](https://app.rerun.io/pr/5166/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! - [PR Build Summary](https://build.rerun.io/pr/5166) - [Docs preview](https://rerun.io/preview/da9a0d206235016d14d9826e8c42ed8481d29643/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/da9a0d206235016d14d9826e8c42ed8481d29643/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) --------- Co-authored-by: Andreas Reich <r_andreas2@web.de>
What
Adds a store subscriber for tracking the dimensions of image entities.
Gets rid of the previous bucketing logic and replaces it with a new implementation that starts at the top of the subspace and incrementally splits when it finds conflicting image entities within the space.
Checklist
main
build: app.rerun.ionightly
build: app.rerun.io