Skip to content

Commit

Permalink
Merge branch 'cmc/datastore/drop_logmsg' into cmc/datastore/new_gc
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc authored Apr 10, 2023
2 parents bb3938f + d48a377 commit a889abf
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
--all-features \
-p re_arrow_store \
-p re_data_store \
-p re_log_types \
-p re_log_encoding \
-p re_query \
-p re_tuid \
-- --output-format=bencher | tee output.txt
Expand Down
5 changes: 2 additions & 3 deletions crates/re_arrow_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ deadlock_detection = ["parking_lot/deadlock_detection"]
## Integration with `polars`, to efficiently use the datastore with dataframes.
polars = ["dep:polars-core", "dep:polars-ops"]

## When set, disables costly benchmark suites that measure the performance of third-party
## libraries.
## When set, only run the core set of benchmark suites.
## Commonly set implicitly by --all-features, e.g. on CI.
dont_bench_third_party = []
core_benchmarks_only = []


[dependencies]
Expand Down
4 changes: 2 additions & 2 deletions crates/re_arrow_store/benches/arrow2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ use re_log_types::{

criterion_group!(benches, erased_clone, estimated_size_bytes);

#[cfg(not(feature = "dont_bench_third_party"))]
#[cfg(not(feature = "core_benchmarks_only"))]
criterion::criterion_main!(benches);

// Don't run these benchmarks on CI: they measure the performance of third-party libraries.
#[cfg(feature = "dont_bench_third_party")]
#[cfg(feature = "core_benchmarks_only")]
fn main() {}

// ---
Expand Down
4 changes: 2 additions & 2 deletions crates/re_arrow_store/benches/arrow2_convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ use re_log_types::{

criterion_group!(benches, serialize, deserialize);

#[cfg(not(feature = "dont_bench_third_party"))]
#[cfg(not(feature = "core_benchmarks_only"))]
criterion::criterion_main!(benches);

// Don't run these benchmarks on CI: they measure the performance of third-party libraries.
#[cfg(feature = "dont_bench_third_party")]
#[cfg(feature = "core_benchmarks_only")]
fn main() {}

// ---
Expand Down
44 changes: 31 additions & 13 deletions crates/re_arrow_store/benches/data_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,32 @@ const NUM_ROWS: i64 = 1;
#[cfg(debug_assertions)]
const NUM_INSTANCES: i64 = 1;

fn packed() -> &'static [bool] {
#[cfg(feature = "core_benchmarks_only")]
{
&[false]
}
#[cfg(not(feature = "core_benchmarks_only"))]
{
&[false, true]
}
}

fn num_rows_per_bucket() -> &'static [u64] {
#[cfg(feature = "core_benchmarks_only")]
{
&[]
}
#[cfg(not(feature = "core_benchmarks_only"))]
{
&[0, 2, 32, 2048]
}
}

// --- Benchmarks ---

fn insert(c: &mut Criterion) {
for packed in [false, true] {
for &packed in packed() {
let mut group = c.benchmark_group(format!(
"datastore/num_rows={NUM_ROWS}/num_instances={NUM_INSTANCES}/packed={packed}/insert"
));
Expand All @@ -46,9 +68,8 @@ fn insert(c: &mut Criterion) {
b.iter(|| insert_table(Default::default(), InstanceKey::name(), &table));
});

// Emulate more or less buckets
let num_rows_per_bucket = [0, 2, 32, 2048];
for num_rows_per_bucket in num_rows_per_bucket {
// Emulate more or less bucket
for &num_rows_per_bucket in num_rows_per_bucket() {
group.bench_function(format!("bucketsz={num_rows_per_bucket}"), |b| {
b.iter(|| {
insert_table(
Expand All @@ -66,7 +87,7 @@ fn insert(c: &mut Criterion) {
}

fn latest_at(c: &mut Criterion) {
for packed in [false, true] {
for &packed in packed() {
let mut group = c.benchmark_group(format!(
"datastore/num_rows={NUM_ROWS}/num_instances={NUM_INSTANCES}/packed={packed}/latest_at"
));
Expand All @@ -91,8 +112,7 @@ fn latest_at(c: &mut Criterion) {
});

// Emulate more or less buckets
let num_rows_per_bucket = [0, 2, 32, 2048];
for num_rows_per_bucket in num_rows_per_bucket {
for &num_rows_per_bucket in num_rows_per_bucket() {
let store = insert_table(
DataStoreConfig {
indexed_bucket_num_rows: num_rows_per_bucket,
Expand All @@ -119,7 +139,7 @@ fn latest_at(c: &mut Criterion) {
}

fn latest_at_missing(c: &mut Criterion) {
for packed in [false, true] {
for &packed in packed() {
let mut group = c.benchmark_group(format!(
"datastore/num_rows={NUM_ROWS}/num_instances={NUM_INSTANCES}/packed={packed}/latest_at_missing"
));
Expand Down Expand Up @@ -154,8 +174,7 @@ fn latest_at_missing(c: &mut Criterion) {
});

// Emulate more or less buckets
let num_rows_per_bucket = [0, 2, 32, 2048];
for num_rows_per_bucket in num_rows_per_bucket {
for &num_rows_per_bucket in num_rows_per_bucket() {
let store = insert_table(
DataStoreConfig {
indexed_bucket_num_rows: num_rows_per_bucket,
Expand Down Expand Up @@ -192,7 +211,7 @@ fn latest_at_missing(c: &mut Criterion) {
}

fn range(c: &mut Criterion) {
for packed in [false, true] {
for &packed in packed() {
let mut group = c.benchmark_group(format!(
"datastore/num_rows={NUM_ROWS}/num_instances={NUM_INSTANCES}/packed={packed}/range"
));
Expand All @@ -208,8 +227,7 @@ fn range(c: &mut Criterion) {
});

// Emulate more or less buckets
let num_rows_per_bucket = [0, 2, 32, 2048];
for num_rows_per_bucket in num_rows_per_bucket {
for &num_rows_per_bucket in num_rows_per_bucket() {
let store = insert_table(
DataStoreConfig {
indexed_bucket_num_rows: num_rows_per_bucket,
Expand Down
4 changes: 2 additions & 2 deletions crates/re_arrow_store/benches/vectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ use tinyvec::TinyVec;

criterion_group!(benches, sort, split, swap, swap_opt);

#[cfg(not(feature = "dont_bench_third_party"))]
#[cfg(not(feature = "core_benchmarks_only"))]
criterion::criterion_main!(benches);

// Don't run these benchmarks on CI: they measure the performance of third-party libraries.
#[cfg(feature = "dont_bench_third_party")]
#[cfg(feature = "core_benchmarks_only")]
fn main() {}

// ---
Expand Down

1 comment on commit a889abf

@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: a889abf Previous: e3f572f Ratio
datastore/num_rows=1000/num_instances=1000/packed=false/insert/default 2493172 ns/iter (± 32525) 11575476 ns/iter (± 688622) 0.22
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at/default 370 ns/iter (± 3) 1809 ns/iter (± 15) 0.20
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/primary/default 262 ns/iter (± 0) 278 ns/iter (± 0) 0.94
datastore/num_rows=1000/num_instances=1000/packed=false/latest_at_missing/secondaries/default 420 ns/iter (± 0) 440 ns/iter (± 2) 0.95
datastore/num_rows=1000/num_instances=1000/packed=false/range/default 2625131 ns/iter (± 45606) 12352247 ns/iter (± 772207) 0.21
mono_points_arrow/generate_message_bundles 27981679 ns/iter (± 427787) 48276625 ns/iter (± 1397029) 0.58
mono_points_arrow/generate_messages 114218442 ns/iter (± 914602) 172700989 ns/iter (± 1490257) 0.66
mono_points_arrow/encode_log_msg 155130549 ns/iter (± 2102982) 200215428 ns/iter (± 1409723) 0.77
mono_points_arrow/encode_total 290410867 ns/iter (± 1482761) 423220801 ns/iter (± 2426710) 0.69
mono_points_arrow/decode_log_msg 178057447 ns/iter (± 673276) 253529959 ns/iter (± 1198838) 0.70
mono_points_arrow/decode_message_bundles 60925200 ns/iter (± 507883) 84116550 ns/iter (± 1373716) 0.72
mono_points_arrow/decode_total 236696708 ns/iter (± 1062047) 344891240 ns/iter (± 2570130) 0.69
mono_points_arrow_batched/generate_message_bundles 21948129 ns/iter (± 990466) 41535573 ns/iter (± 1799262) 0.53
mono_points_arrow_batched/generate_messages 4580723 ns/iter (± 159754) 8656223 ns/iter (± 993434) 0.53
mono_points_arrow_batched/encode_log_msg 1379279 ns/iter (± 4409) 1658024 ns/iter (± 5637) 0.83
mono_points_arrow_batched/encode_total 29621541 ns/iter (± 1163999) 53520656 ns/iter (± 2841832) 0.55
mono_points_arrow_batched/decode_log_msg 784267 ns/iter (± 2603) 945416 ns/iter (± 3479) 0.83
mono_points_arrow_batched/decode_message_bundles 7717233 ns/iter (± 186748) 12660668 ns/iter (± 673928) 0.61
mono_points_arrow_batched/decode_total 9002045 ns/iter (± 313841) 14547484 ns/iter (± 923681) 0.62
batch_points_arrow/generate_message_bundles 240791 ns/iter (± 458) 336960 ns/iter (± 1141) 0.71
batch_points_arrow/generate_messages 5122 ns/iter (± 15) 6376 ns/iter (± 28) 0.80
batch_points_arrow/encode_log_msg 265927 ns/iter (± 1247) 453146 ns/iter (± 1968) 0.59
batch_points_arrow/encode_total 539116 ns/iter (± 2351) 798510 ns/iter (± 3665) 0.68
batch_points_arrow/decode_log_msg 213761 ns/iter (± 517) 392739 ns/iter (± 1564) 0.54
batch_points_arrow/decode_message_bundles 1900 ns/iter (± 10) 2314 ns/iter (± 6) 0.82
batch_points_arrow/decode_total 220580 ns/iter (± 861) 393182 ns/iter (± 1465) 0.56
arrow_mono_points/insert 1792578633 ns/iter (± 2165172) 7518086366 ns/iter (± 21814282) 0.24
arrow_mono_points/query 1605489 ns/iter (± 12244) 1856154 ns/iter (± 17882) 0.86
arrow_batch_points/insert 780085 ns/iter (± 1119) 3334078 ns/iter (± 13647) 0.23
arrow_batch_points/query 15975 ns/iter (± 15) 17120 ns/iter (± 49) 0.93
arrow_batch_vecs/insert 26293 ns/iter (± 67) 47904 ns/iter (± 197) 0.55
arrow_batch_vecs/query 535506 ns/iter (± 495) 522963 ns/iter (± 1398) 1.02
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.