Skip to content

Commit

Permalink
Add re_arrow_store profile scopes (#1546)
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Mar 9, 2023
1 parent 15d21af commit dd2a542
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/re_arrow_store/src/store_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,7 @@ impl IndexBucket {
return; // early read-only exit
}

crate::profile_scope!("sort");
self.indices.write().sort();
}

Expand All @@ -846,6 +847,7 @@ impl IndexBucket {
primary: ComponentName,
components: &[ComponentName; N],
) -> Option<[Option<RowIndex>; N]> {
crate::profile_function!();
self.sort_indices_if_needed();

let IndexBucketIndices {
Expand Down
8 changes: 8 additions & 0 deletions crates/re_arrow_store/src/store_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ impl DataStore {
/// Returns the number of timeless index rows stored across this entire store, i.e. the sum of
/// the number of rows across all of its timeless index tables.
pub fn total_timeless_index_rows(&self) -> u64 {
crate::profile_function!();
self.timeless_indices
.values()
.map(|table| table.total_rows())
Expand All @@ -78,6 +79,7 @@ impl DataStore {
/// Returns the size of the timeless index data stored across this entire store, i.e. the sum
/// of the size of the data stored across all of its timeless index tables, in bytes.
pub fn total_timeless_index_size_bytes(&self) -> u64 {
crate::profile_function!();
self.timeless_indices
.values()
.map(|table| table.total_size_bytes())
Expand All @@ -87,6 +89,7 @@ impl DataStore {
/// Returns the number of timeless component rows stored across this entire store, i.e. the
/// sum of the number of rows across all of its timeless component tables.
pub fn total_timeless_component_rows(&self) -> u64 {
crate::profile_function!();
self.timeless_components
.values()
.map(|table| table.total_rows())
Expand All @@ -96,6 +99,7 @@ impl DataStore {
/// Returns the size of the timeless component data stored across this entire store, i.e. the
/// sum of the size of the data stored across all of its timeless component tables, in bytes.
pub fn total_timeless_component_size_bytes(&self) -> u64 {
crate::profile_function!();
self.timeless_components
.values()
.map(|table| table.total_size_bytes())
Expand All @@ -105,12 +109,14 @@ impl DataStore {
/// Returns the number of temporal index rows stored across this entire store, i.e. the sum of
/// the number of rows across all of its temporal index tables.
pub fn total_temporal_index_rows(&self) -> u64 {
crate::profile_function!();
self.indices.values().map(|table| table.total_rows()).sum()
}

/// Returns the size of the temporal index data stored across this entire store, i.e. the sum
/// of the size of the data stored across all of its temporal index tables, in bytes.
pub fn total_temporal_index_size_bytes(&self) -> u64 {
crate::profile_function!();
self.indices
.values()
.map(|table| table.total_size_bytes())
Expand All @@ -120,6 +126,7 @@ impl DataStore {
/// Returns the number of temporal component rows stored across this entire store, i.e. the
/// sum of the number of rows across all of its temporal component tables.
pub fn total_temporal_component_rows(&self) -> u64 {
crate::profile_function!();
self.components
.values()
.map(|table| table.total_rows())
Expand All @@ -129,6 +136,7 @@ impl DataStore {
/// Returns the size of the temporal component data stored across this entire store, i.e. the
/// sum of the size of the data stored across all of its temporal component tables, in bytes.
pub fn total_temporal_component_size_bytes(&self) -> u64 {
crate::profile_function!();
self.components
.values()
.map(|table| table.total_size_bytes())
Expand Down

1 comment on commit dd2a542

@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: dd2a542 Previous: 15d21af Ratio
datastore/insert/batch/rects/insert 570651 ns/iter (± 3533) 566556 ns/iter (± 2074) 1.01
datastore/latest_at/batch/rects/query 1801 ns/iter (± 8) 1813 ns/iter (± 7) 0.99
datastore/latest_at/missing_components/primary 363 ns/iter (± 0) 357 ns/iter (± 0) 1.02
datastore/latest_at/missing_components/secondaries 425 ns/iter (± 0) 435 ns/iter (± 0) 0.98
datastore/range/batch/rects/query 149518 ns/iter (± 251) 149619 ns/iter (± 675) 1.00
mono_points_arrow/generate_message_bundles 47416340 ns/iter (± 734945) 51781758 ns/iter (± 969302) 0.92
mono_points_arrow/generate_messages 125466343 ns/iter (± 6485212) 138572153 ns/iter (± 1660401) 0.91
mono_points_arrow/encode_log_msg 150750510 ns/iter (± 1405395) 167278114 ns/iter (± 2069391) 0.90
mono_points_arrow/encode_total 325110979 ns/iter (± 2677415) 357409126 ns/iter (± 3282007) 0.91
mono_points_arrow/decode_log_msg 176547565 ns/iter (± 1348562) 189040007 ns/iter (± 1038365) 0.93
mono_points_arrow/decode_message_bundles 63845690 ns/iter (± 777029) 75300058 ns/iter (± 2063194) 0.85
mono_points_arrow/decode_total 239380655 ns/iter (± 2386117) 260353313 ns/iter (± 1845927) 0.92
batch_points_arrow/generate_message_bundles 328465 ns/iter (± 3781) 335397 ns/iter (± 762) 0.98
batch_points_arrow/generate_messages 6110 ns/iter (± 94) 6241 ns/iter (± 10) 0.98
batch_points_arrow/encode_log_msg 372431 ns/iter (± 2194) 371116 ns/iter (± 12662) 1.00
batch_points_arrow/encode_total 718603 ns/iter (± 43942) 732303 ns/iter (± 2462) 0.98
batch_points_arrow/decode_log_msg 347345 ns/iter (± 1881) 358824 ns/iter (± 2352) 0.97
batch_points_arrow/decode_message_bundles 2086 ns/iter (± 22) 2120 ns/iter (± 4) 0.98
batch_points_arrow/decode_total 352211 ns/iter (± 1735) 356404 ns/iter (± 1855) 0.99
arrow_mono_points/insert 6072775620 ns/iter (± 14109546) 7015828214 ns/iter (± 60439192) 0.87
arrow_mono_points/query 1705040 ns/iter (± 18823) 1752509 ns/iter (± 21321) 0.97
arrow_batch_points/insert 2586681 ns/iter (± 19981) 2622280 ns/iter (± 28191) 0.99
arrow_batch_points/query 16738 ns/iter (± 187) 16814 ns/iter (± 16) 1.00
arrow_batch_vecs/insert 42837 ns/iter (± 385) 43081 ns/iter (± 111) 0.99
arrow_batch_vecs/query 502694 ns/iter (± 8265) 505661 ns/iter (± 372) 0.99
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.