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

Speed up query usage in heuristics by splitting DataQuery into separate query and update_properties passes #4563

Merged
merged 12 commits into from
Dec 21, 2023
19 changes: 2 additions & 17 deletions crates/re_space_view/src/data_query.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use re_data_store::{EntityProperties, EntityPropertyMap};
use re_viewer_context::{DataQueryResult, EntitiesPerSystem, StoreContext};

pub struct EntityOverrides {
pub struct EntityOverrideContext {
pub root: EntityProperties,
pub individual: EntityPropertyMap,
pub group: EntityPropertyMap,
Expand All @@ -12,23 +12,9 @@ pub struct EntityOverrides {
/// The `SpaceViewBlueprint` is the only thing that likely implements this today
/// but we use a trait here so we don't have to pick up a full dependency on `re_viewport`.
pub trait PropertyResolver {
fn resolve_entity_overrides(&self, ctx: &StoreContext<'_>) -> EntityOverrides;
fn update_overrides(&self, ctx: &StoreContext<'_>, query_result: &mut DataQueryResult);
}

pub struct NoopResolver {}

impl PropertyResolver for NoopResolver {
fn resolve_entity_overrides(&self, _ctx: &StoreContext<'_>) -> EntityOverrides {
EntityOverrides {
root: EntityProperties::default(),
individual: EntityPropertyMap::default(),
group: EntityPropertyMap::default(),
}
}
}

pub static NOOP_RESOLVER: NoopResolver = NoopResolver {};

/// The common trait implemented for data queries
///
/// Both interfaces return [`re_viewer_context::DataResult`]s, which are self-contained description of the data
Expand All @@ -41,7 +27,6 @@ pub trait DataQuery {
/// This is used when building up the contents for a `SpaceView`.
fn execute_query(
&self,
property_resolver: &impl PropertyResolver,
ctx: &StoreContext<'_>,
entities_per_system: &EntitiesPerSystem,
) -> DataQueryResult;
Expand Down
Loading
Loading