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 datagen #6152

Merged
merged 4 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/re_data_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ web-time.workspace = true

[dev-dependencies]
re_format.workspace = true
re_types = { workspace = true, features = ["datagen", "testing"] }
re_types = { workspace = true, features = ["testing"] }

anyhow.workspace = true
criterion.workspace = true
Expand Down
18 changes: 8 additions & 10 deletions crates/re_data_store/benches/arrow2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ use arrow2::array::{Array, FixedSizeListArray, PrimitiveArray, StructArray};
use criterion::Criterion;
use itertools::Itertools;

use re_log_types::example_components::MyIndex;
use re_log_types::example_components::{MyIndex, MyPoint};
use re_log_types::DataCell;
use re_types::datagen::build_some_positions2d;
use re_types::{
components::Position2D,
testing::{build_some_large_structs, LargeStruct},
};
use re_types::testing::{build_some_large_structs, LargeStruct};
use re_types_core::{Component, SizeBytes};

// ---
Expand Down Expand Up @@ -85,7 +81,7 @@ fn erased_clone(c: &mut Criterion) {
bench_native(&mut group, &data);
}
ArrayKind::Struct => {
let data = build_some_positions2d(NUM_INSTANCES);
let data = MyPoint::from_iter(0..NUM_INSTANCES as u32);
bench_arrow(&mut group, &data);
bench_native(&mut group, &data);
}
Expand Down Expand Up @@ -205,7 +201,9 @@ fn estimated_size_bytes(c: &mut Criterion) {
.collect(),
ArrayKind::Struct => (0..NUM_ROWS)
.map(|_| {
DataCell::from_native(build_some_positions2d(NUM_INSTANCES).as_slice())
DataCell::from_native(
MyPoint::from_iter(0..NUM_INSTANCES as u32).as_slice(),
)
})
.collect(),
ArrayKind::StructLarge => (0..NUM_ROWS)
Expand Down Expand Up @@ -309,9 +307,9 @@ fn estimated_size_bytes(c: &mut Criterion) {
}

{
fn generate_positions() -> Vec<Vec<Position2D>> {
fn generate_positions() -> Vec<Vec<MyPoint>> {
(0..NUM_ROWS)
.map(|_| build_some_positions2d(NUM_INSTANCES))
.map(|_| MyPoint::from_iter(0..NUM_INSTANCES as u32))
.collect()
}

Expand Down
7 changes: 3 additions & 4 deletions crates/re_data_store/tests/correctness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ use re_data_store::{
test_row, test_util::sanity_unwrap, DataStore, DataStoreConfig, DataStoreStats,
GarbageCollectionOptions, LatestAtQuery, WriteError,
};
use re_log_types::example_components::{MyIndex, MyPoint};
use re_log_types::example_components::{MyColor, MyIndex, MyPoint};
use re_log_types::{
build_frame_nr, build_log_time, DataRow, Duration, EntityPath, RowId, Time, TimeInt, TimePoint,
TimeType, Timeline,
};
use re_types::datagen::{build_some_colors, build_some_positions2d};
use re_types_core::Loggable as _;

// ---
Expand Down Expand Up @@ -206,7 +205,7 @@ fn write_errors() {
let mut row = test_row!(entity_path @ [
build_frame_nr(1),
build_log_time(Time::now()),
] => [ build_some_positions2d(1) ]);
] => [ MyPoint::from_iter(0..1) ]);

row.row_id = re_log_types::RowId::new();
store.insert_row(&row).unwrap();
Expand Down Expand Up @@ -368,7 +367,7 @@ fn gc_correct() {
let row = test_row!(entity_path @ [
build_frame_nr(frame_nr),
] => [
build_some_colors(num_instances as _),
MyColor::from_iter(0..num_instances),
]);
store.insert_row(&row).unwrap();
}
Expand Down