Skip to content

Commit

Permalink
Remove the redundant costly transform check during categorization (#1695
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jleibs authored Mar 23, 2023
1 parent 6070aa8 commit 1802c20
Showing 1 changed file with 1 addition and 13 deletions.
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()
{
set.insert(ViewCategory::Spatial);
}

for component in log_db
.entity_db
.data_store
Expand Down

1 comment on commit 1802c20

@github-actions
Copy link

Choose a reason for hiding this comment

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

Rust Benchmark

Benchmark suite Current: 1802c20 Previous: 6070aa8 Ratio
datastore/insert/batch/rects/insert 558040 ns/iter (± 2726) 557105 ns/iter (± 2814) 1.00
datastore/latest_at/batch/rects/query 1869 ns/iter (± 5) 1847 ns/iter (± 10) 1.01
datastore/latest_at/missing_components/primary 287 ns/iter (± 0) 290 ns/iter (± 3) 0.99
datastore/latest_at/missing_components/secondaries 456 ns/iter (± 0) 438 ns/iter (± 3) 1.04
datastore/range/batch/rects/query 153037 ns/iter (± 237) 150415 ns/iter (± 758) 1.02
mono_points_arrow/generate_message_bundles 52357104 ns/iter (± 640637) 50932375 ns/iter (± 934026) 1.03
mono_points_arrow/generate_messages 136205204 ns/iter (± 1313776) 137021163 ns/iter (± 1461987) 0.99
mono_points_arrow/encode_log_msg 171213456 ns/iter (± 1741778) 168160906 ns/iter (± 1304653) 1.02
mono_points_arrow/encode_total 362883755 ns/iter (± 2060012) 360167647 ns/iter (± 1876297) 1.01
mono_points_arrow/decode_log_msg 189752854 ns/iter (± 4013520) 188199656 ns/iter (± 992594) 1.01
mono_points_arrow/decode_message_bundles 75254710 ns/iter (± 1140876) 74053748 ns/iter (± 1003634) 1.02
mono_points_arrow/decode_total 259499357 ns/iter (± 2333802) 257136517 ns/iter (± 1984077) 1.01
batch_points_arrow/generate_message_bundles 341982 ns/iter (± 553) 341767 ns/iter (± 949) 1.00
batch_points_arrow/generate_messages 6228 ns/iter (± 13) 6179 ns/iter (± 18) 1.01
batch_points_arrow/encode_log_msg 372885 ns/iter (± 1494) 367448 ns/iter (± 1683) 1.01
batch_points_arrow/encode_total 746449 ns/iter (± 4228) 741146 ns/iter (± 3525) 1.01
batch_points_arrow/decode_log_msg 354317 ns/iter (± 1692) 345358 ns/iter (± 1518) 1.03
batch_points_arrow/decode_message_bundles 2018 ns/iter (± 8) 2047 ns/iter (± 5) 0.99
batch_points_arrow/decode_total 360005 ns/iter (± 2070) 354881 ns/iter (± 3713) 1.01
arrow_mono_points/insert 7101183936 ns/iter (± 48000479) 7044230787 ns/iter (± 16622465) 1.01
arrow_mono_points/query 1847772 ns/iter (± 25156) 1813199 ns/iter (± 23546) 1.02
arrow_batch_points/insert 2738045 ns/iter (± 81908) 2674140 ns/iter (± 33795) 1.02
arrow_batch_points/query 16152 ns/iter (± 40) 16095 ns/iter (± 90) 1.00
arrow_batch_vecs/insert 43144 ns/iter (± 226) 43380 ns/iter (± 313) 0.99
arrow_batch_vecs/query 389549 ns/iter (± 596) 389847 ns/iter (± 2421) 1.00
tuid/Tuid::random 34 ns/iter (± 0) 34 ns/iter (± 0) 1

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.