Skip to content

Commit

Permalink
Need to use points as primary when querying labels
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs committed Aug 7, 2023
1 parent 72d86ff commit 603778d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions crates/re_query/benches/query_benchmark2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,24 @@ fn build_points_rows(paths: &[EntityPath], pts: usize) -> Vec<DataRow> {
.collect()
}

fn build_strings_rows(paths: &[EntityPath], strings: usize) -> Vec<DataRow> {
fn build_strings_rows(paths: &[EntityPath], num_strings: usize) -> Vec<DataRow> {
(0..NUM_FRAMES_STRINGS)
.flat_map(move |frame_idx| {
paths.iter().map(move |path| {
let mut row = DataRow::from_cells1(
let mut row = DataRow::from_cells2(
RowId::ZERO,
path.clone(),
[build_frame_nr((frame_idx as i64).into())],
strings as _,
build_some_strings(strings),
num_strings as _,
// We still need to create points because they are the primary for the
// archetype query we want to do. We won't actually deserialize the points
// during the query -- we just need it for the primary keys.
// TODO(jleibs): switch this to use `TextEntry` once the new type has
// landed.
(
build_some_point2d(num_strings),
build_some_strings(num_strings),
),
);
// NOTE: Using unsized cells will crash in debug mode, and benchmarks are run for 1 iteration,
// in debug mode, by the standard test harness.
Expand Down

0 comments on commit 603778d

Please sign in to comment.