From dbfbac6aeebea768711605330ca153bd8c5f1500 Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Wed, 11 Dec 2024 14:29:46 +0100 Subject: [PATCH] Remove some too frequent profile scopes --- crates/store/re_query/src/latest_at.rs | 4 +--- crates/viewer/re_view/src/query.rs | 2 +- crates/viewer/re_view/src/results_ext.rs | 2 +- .../viewer/re_view_spatial/src/contexts/transform_context.rs | 2 +- crates/viewer/re_view_spatial/src/mesh_cache.rs | 2 -- crates/viewer/re_viewport_blueprint/src/view_contents.rs | 4 +--- 6 files changed, 5 insertions(+), 11 deletions(-) diff --git a/crates/store/re_query/src/latest_at.rs b/crates/store/re_query/src/latest_at.rs index e4f641665dd6..02a42649a4cb 100644 --- a/crates/store/re_query/src/latest_at.rs +++ b/crates/store/re_query/src/latest_at.rs @@ -48,7 +48,7 @@ impl QueryCache { entity_path: &EntityPath, component_descrs: impl IntoIterator>>, ) -> LatestAtResults { - re_tracing::profile_function!(entity_path.to_string()); + // This is called very frequently, don't put a profile scope here. let store = self.store.read(); @@ -87,8 +87,6 @@ impl QueryCache { // the data. let mut max_clear_index = (TimeInt::MIN, RowId::ZERO); { - re_tracing::profile_scope!("clears"); - let potential_clears = self.might_require_clearing.read(); let mut clear_entity_path = entity_path.clone(); diff --git a/crates/viewer/re_view/src/query.rs b/crates/viewer/re_view/src/query.rs index e554f4d07fef..98f3bcdd2ab5 100644 --- a/crates/viewer/re_view/src/query.rs +++ b/crates/viewer/re_view/src/query.rs @@ -85,7 +85,7 @@ pub fn latest_at_with_blueprint_resolved_data<'a>( component_names: impl IntoIterator, query_shadowed_defaults: bool, ) -> HybridLatestAtResults<'a> { - re_tracing::profile_function!(data_result.entity_path.to_string()); + // This is called very frequently, don't put a profile scope here. let mut component_set = component_names.into_iter().collect::>(); diff --git a/crates/viewer/re_view/src/results_ext.rs b/crates/viewer/re_view/src/results_ext.rs index 71eca73654c3..8e9300a4d508 100644 --- a/crates/viewer/re_view/src/results_ext.rs +++ b/crates/viewer/re_view/src/results_ext.rs @@ -135,7 +135,7 @@ pub enum HybridResults<'a> { impl HybridResults<'_> { pub fn query_result_hash(&self) -> Hash64 { - re_tracing::profile_function!(); + // This is called very frequently, don't put a profile scope here. // TODO(andreas): We should be able to do better than this and determine hashes for queries on the fly. match self { diff --git a/crates/viewer/re_view_spatial/src/contexts/transform_context.rs b/crates/viewer/re_view_spatial/src/contexts/transform_context.rs index 20122a8313ed..82a596ea58b6 100644 --- a/crates/viewer/re_view_spatial/src/contexts/transform_context.rs +++ b/crates/viewer/re_view_spatial/src/contexts/transform_context.rs @@ -734,7 +734,7 @@ fn transforms_at( pinhole_image_plane_distance: impl Fn(&EntityPath) -> f32, encountered_pinhole: &mut Option, ) -> Result { - re_tracing::profile_function!(); + // This is called very frequently, don't put a profile scope here. let potential_transform_components = TransformComponentTrackerStoreSubscriber::access(&entity_db.store_id(), |tracker| { diff --git a/crates/viewer/re_view_spatial/src/mesh_cache.rs b/crates/viewer/re_view_spatial/src/mesh_cache.rs index ff95fa76859b..9da0b806a3b5 100644 --- a/crates/viewer/re_view_spatial/src/mesh_cache.rs +++ b/crates/viewer/re_view_spatial/src/mesh_cache.rs @@ -56,8 +56,6 @@ impl MeshCache { mesh: AnyMesh<'_>, render_ctx: &RenderContext, ) -> Option> { - re_tracing::profile_function!(); - self.0 .entry(key.versioned_instance_path_hash.row_id) .or_default() diff --git a/crates/viewer/re_viewport_blueprint/src/view_contents.rs b/crates/viewer/re_viewport_blueprint/src/view_contents.rs index 720be6c9ccec..06fd584df7b8 100644 --- a/crates/viewer/re_viewport_blueprint/src/view_contents.rs +++ b/crates/viewer/re_viewport_blueprint/src/view_contents.rs @@ -393,8 +393,6 @@ impl DataQueryPropertyResolver<'_> { // Update visualizers from overrides. if !node.data_result.visualizers.is_empty() { - re_tracing::profile_scope!("Update visualizers from overrides"); - // If the user has overridden the visualizers, update which visualizers are used. if let Some(viz_override) = blueprint .latest_at_component::( @@ -524,7 +522,7 @@ impl DataQueryPropertyResolver<'_> { query_result: &mut DataQueryResult, view_states: &mut ViewStates, ) { - re_tracing::profile_function!(); + // This is called very frequently, don't put a profile scope here. if let Some(root) = query_result.tree.root_handle() { let recursive_property_overrides = Default::default();