From e4b3b3f962378dbdf4039d39fe0c30f5b65c68f8 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Thu, 23 Mar 2023 23:06:19 +0100 Subject: [PATCH] oh. my. god. --- crates/re_arrow_store/src/store_write.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/re_arrow_store/src/store_write.rs b/crates/re_arrow_store/src/store_write.rs index cbc246520157..6a9259357d61 100644 --- a/crates/re_arrow_store/src/store_write.rs +++ b/crates/re_arrow_store/src/store_write.rs @@ -311,7 +311,19 @@ impl DataStore { (len, ClusterData::Cached(*row_idx)) } else { // Cache miss! Craft a new instance keys from the ground up. - let cell = DataCell::from_component::(0..len as u64); + + // TODO(cmc): That's exactly how one should create a cell of instance keys... but + // it turns out that running `TryIntoArrow` on a primitive type is orders of + // magnitude slower than manually creating the equivalent primitive array for some + // reason... + // let cell = DataCell::from_component::(0..len as u64); + + // ...so we create it manually instead. + use re_log_types::msg_bundle::Component as _; + let values = + arrow2::array::UInt64Array::from_vec((0..len as u64).collect_vec()).boxed(); + let cell = DataCell::from_arrow(InstanceKey::name(), values); + (len, ClusterData::GenData(cell)) } };