Skip to content

Commit

Permalink
Test owned array performance
Browse files Browse the repository at this point in the history
  • Loading branch information
gatesn committed Feb 17, 2025
1 parent 8959e6e commit 3173413
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions encodings/dict/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ impl ValidityVTable<DictArray> for DictEncoding {

impl VisitorVTable<DictArray> for DictEncoding {
fn accept(&self, array: &DictArray, visitor: &mut dyn ArrayVisitor) -> VortexResult<()> {
visitor.visit_child("values", &array.values())?;
visitor.visit_child("codes", &array.codes())
visitor.visit_child("codes", &array.codes())?;
visitor.visit_child("values", &array.values())
}
}

Expand Down
18 changes: 12 additions & 6 deletions vortex-array/src/data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,19 @@ impl Array {
InnerArray::Owned(_) => self,
InnerArray::Viewed(v) => Array::try_new_owned(
self.vtable().clone(),
v.dtype.clone(),
self.dtype().clone(),
v.len,
v.flatbuffer()
.metadata()
.map(|bytes| v.flatbuffer.clone().into_inner().slice_ref(bytes.bytes())),
Some(v.buffers.iter().cloned().collect()),
Some(self.children().into()),
// v.flatbuffer()
// .metadata()
// .map(|bytes| v.flatbuffer.clone().into_inner().slice_ref(bytes.bytes())),
self.metadata_bytes().map(|b| ByteBuffer::copy_from(b)),
Some(self.byte_buffers().collect()),
Some(
self.children()
.into_iter()
.map(|a| a.into_owned_array())
.collect(),
),
self.statistics().stats_set(),
)
.vortex_expect("Failed to create owned array"),
Expand Down
1 change: 1 addition & 0 deletions vortex-array/src/data/owned.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::sync::RwLock;

use itertools::Itertools;
use vortex_buffer::ByteBuffer;
use vortex_dtype::DType;
use vortex_error::{vortex_bail, VortexResult};
Expand Down

0 comments on commit 3173413

Please sign in to comment.