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

Remove the redundant costly transform check during categorization #1695

Merged
merged 1 commit into from
Mar 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions crates/re_viewer/src/ui/view_category.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use re_arrow_store::{LatestAtQuery, TimeInt};
use re_data_store::{query_latest_single, EntityPath, LogDb, Timeline};
use re_data_store::{EntityPath, LogDb, Timeline};
use re_log_types::{
component_types::{
Box3D, LineStrip2D, LineStrip3D, Point2D, Point3D, Rect2D, Scalar, Tensor, TensorTrait,
Expand Down Expand Up @@ -71,18 +71,6 @@ pub fn categorize_entity_path(

let mut set = ViewCategorySet::default();

// If it has a transform we might want to visualize it in space
// (as of writing we do that only for projections, i.e. cameras, but visualizations for rigid transforms may be added)
if query_latest_single::<Transform>(
&log_db.entity_db,
entity_path,
&LatestAtQuery::new(timeline, TimeInt::MAX),
)
.is_some()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this is a query over all time anyways, this seems completley redundant with the below, faster, check of simply, "Does this entity path include a transform component"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

{
set.insert(ViewCategory::Spatial);
}

for component in log_db
.entity_db
.data_store
Expand Down