Skip to content

Commit 80ca709

Browse files
committed
Faster pipelines
Signed-off-by: Nicholas Gates <[email protected]>
1 parent 198192d commit 80ca709

File tree

21 files changed

+42
-99
lines changed

21 files changed

+42
-99
lines changed

encodings/fastlanes/src/bitpacking/array/bitpack_pipeline.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4+
use std::mem::{transmute, transmute_copy};
5+
46
use fastlanes::{BitPacking, FastLanes};
57
use static_assertions::const_assert_eq;
6-
use std::mem::{transmute, transmute_copy};
78
use vortex_array::pipeline::bit_view::BitView;
8-
use vortex_array::pipeline::{BindContext, Kernel, KernelCtx, PipelineInputs, PipelinedNode, N};
9+
use vortex_array::pipeline::{BindContext, Kernel, KernelCtx, N, PipelineInputs, PipelinedNode};
910
use vortex_buffer::Buffer;
10-
use vortex_dtype::{match_each_integer_ptype, PTypeDowncastExt, PhysicalPType};
11+
use vortex_dtype::{PTypeDowncastExt, PhysicalPType, match_each_integer_ptype};
1112
use vortex_error::VortexResult;
1213
use vortex_mask::MaskMut;
1314
use vortex_vector::primitive::PVectorMut;
14-
use vortex_vector::VectorMut;
15-
use vortex_vector::VectorMutOps;
15+
use vortex_vector::{VectorMut, VectorMutOps};
1616

1717
use crate::BitPackedArray;
1818

@@ -200,12 +200,13 @@ impl<BP: PhysicalPType<Physical: BitPacking>> Kernel for AlignedBitPackedKernel<
200200

201201
#[cfg(test)]
202202
mod tests {
203-
use crate::BitPackedArray;
204203
use vortex_array::arrays::PrimitiveArray;
205204
use vortex_dtype::PTypeDowncast;
206205
use vortex_mask::Mask;
207206
use vortex_vector::VectorOps;
208207

208+
use crate::BitPackedArray;
209+
209210
#[test]
210211
fn test_bitpack_pipeline_basic() {
211212
// Create exactly 1024 elements (0 to 1023).

vortex-array/src/pipeline/driver/allocation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
use vortex_error::{VortexExpect, VortexResult};
77
use vortex_vector::VectorMut;
88

9-
use crate::pipeline::driver::{Node, NodeId};
10-
use crate::pipeline::{VectorId, N};
119
use crate::Array;
10+
use crate::pipeline::driver::{Node, NodeId};
11+
use crate::pipeline::{N, VectorId};
1212

1313
#[derive(Debug)]
1414
pub struct VectorAllocation {

vortex-array/src/pipeline/driver/input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl Kernel for InputKernel {
7373

7474
#[cfg(test)]
7575
mod test {
76-
use vortex_buffer::{bitbuffer, buffer, BitBuffer};
76+
use vortex_buffer::{BitBuffer, bitbuffer, buffer};
7777
use vortex_dtype::PTypeDowncastExt;
7878
use vortex_mask::Mask;
7979

vortex-array/src/pipeline/driver/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ use std::hash::{BuildHasher, Hash, Hasher};
1111

1212
use itertools::Itertools;
1313
use vortex_dtype::DType;
14-
use vortex_error::{vortex_ensure, VortexResult};
14+
use vortex_error::{VortexResult, vortex_ensure};
1515
use vortex_mask::Mask;
1616
use vortex_utils::aliases::hash_map::{HashMap, RandomState};
1717
use vortex_vector::{Vector, VectorMut, VectorMutOps};
1818

1919
use crate::pipeline::bit_view::{BitView, BitViewExt};
20-
use crate::pipeline::driver::allocation::{allocate_vectors, OutputTarget};
20+
use crate::pipeline::driver::allocation::{OutputTarget, allocate_vectors};
2121
use crate::pipeline::driver::bind::bind_kernels;
2222
use crate::pipeline::driver::toposort::topological_sort;
23-
use crate::pipeline::{Kernel, KernelCtx, PipelineInputs, N};
23+
use crate::pipeline::{Kernel, KernelCtx, N, PipelineInputs};
2424
use crate::{Array, ArrayEq, ArrayHash, ArrayOperator, ArrayRef, ArrayVisitor, Precision};
2525

2626
/// A pipeline driver takes a Vortex array and executes it into a canonical vector.

vortex-array/src/pipeline/filter/buffer.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4-
use crate::pipeline::bit_view::BitView;
5-
use crate::pipeline::N;
64
use vortex_compute::filter::Filter;
75

6+
use crate::pipeline::N;
7+
use crate::pipeline::bit_view::BitView;
8+
89
impl<'a, T: Copy> Filter<BitView<'a>> for &'a mut [T] {
910
type Output = ();
1011

vortex-array/src/pipeline/filter/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33

44
mod buffer;
55

6-
use crate::pipeline::bit_view::BitView;
76
use vortex_compute::filter::Filter;
87
use vortex_dtype::NativePType;
98
use vortex_mask::MaskMut;
109
use vortex_vector::primitive::{PVectorMut, PrimitiveVectorMut};
11-
use vortex_vector::{match_each_pvector_mut, VectorMut, VectorMutOps};
10+
use vortex_vector::{VectorMut, match_each_pvector_mut};
11+
12+
use crate::pipeline::bit_view::BitView;
1213

1314
impl Filter<BitView<'_>> for &mut VectorMut {
1415
type Output = ();

vortex-buffer/src/bit/buf.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ use std::ops::{BitAnd, BitOr, BitXor, Not, RangeBounds};
55

66
use crate::bit::ops::{bitwise_binary_op, bitwise_unary_op};
77
use crate::bit::{
8-
get_bit_unchecked, BitChunks, BitIndexIterator, BitIterator, BitSliceIterator,
9-
UnalignedBitChunk,
8+
BitChunks, BitIndexIterator, BitIterator, BitSliceIterator, UnalignedBitChunk,
9+
get_bit_unchecked,
1010
};
11-
use crate::{buffer, Alignment, BitBufferMut, Buffer, BufferMut, ByteBuffer};
11+
use crate::{Alignment, BitBufferMut, Buffer, BufferMut, ByteBuffer, buffer};
1212

1313
/// An immutable bitset stored as a packed byte buffer.
1414
#[derive(Debug, Clone, Eq)]
@@ -495,7 +495,7 @@ mod tests {
495495
use rstest::rstest;
496496

497497
use crate::bit::BitBuffer;
498-
use crate::{buffer, ByteBuffer};
498+
use crate::{ByteBuffer, buffer};
499499

500500
#[test]
501501
fn test_bool() {

vortex-buffer/src/buffer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::marker::PhantomData;
1010
use std::ops::{Deref, RangeBounds};
1111

1212
use bytes::{Buf, Bytes};
13-
use vortex_error::{vortex_panic, VortexExpect};
13+
use vortex_error::{VortexExpect, vortex_panic};
1414

1515
use crate::debug::TruncatedDebug;
1616
use crate::trusted_len::TrustedLen;
@@ -657,7 +657,7 @@ impl<T> From<BufferMut<T>> for Buffer<T> {
657657
mod test {
658658
use bytes::Buf;
659659

660-
use crate::{buffer, Alignment, Buffer, ByteBuffer};
660+
use crate::{Alignment, Buffer, ByteBuffer, buffer};
661661

662662
#[test]
663663
fn align() {

vortex-mask/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ use std::sync::{Arc, OnceLock};
2020

2121
use itertools::Itertools;
2222
pub use mask_mut::*;
23-
use vortex_buffer::{set_bit_unchecked, BitBuffer, BitBufferMut};
24-
use vortex_error::{vortex_panic, VortexResult};
23+
use vortex_buffer::{BitBuffer, BitBufferMut, set_bit_unchecked};
24+
use vortex_error::{VortexResult, vortex_panic};
2525

2626
/// Represents a set of values that are all included, all excluded, or some mixture of both.
2727
pub enum AllOr<T> {

vortex-vector/src/binaryview/vector.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ use std::ops::RangeBounds;
88
use std::sync::Arc;
99

1010
use vortex_buffer::{Alignment, Buffer, ByteBuffer};
11-
use vortex_error::{vortex_ensure, VortexExpect, VortexResult};
11+
use vortex_error::{VortexExpect, VortexResult, vortex_ensure};
1212
use vortex_mask::Mask;
1313

1414
use crate::binaryview::vector_mut::BinaryViewVectorMut;
15-
use crate::binaryview::view::{validate_views, BinaryView};
15+
use crate::binaryview::view::{BinaryView, validate_views};
1616
use crate::binaryview::{BinaryViewScalar, BinaryViewType};
1717
use crate::{Scalar, VectorOps};
1818

@@ -198,11 +198,6 @@ impl<T: BinaryViewType> VectorOps for BinaryViewVector<T> {
198198
self.views.len()
199199
}
200200

201-
fn clear(&mut self) {
202-
self.views.clear();
203-
self.validity.clear();
204-
}
205-
206201
fn validity(&self) -> &Mask {
207202
&self.validity
208203
}
@@ -280,7 +275,7 @@ impl<T: BinaryViewType> VectorOps for BinaryViewVector<T> {
280275
mod tests {
281276
use std::sync::Arc;
282277

283-
use vortex_buffer::{buffer, ByteBuffer};
278+
use vortex_buffer::{ByteBuffer, buffer};
284279
use vortex_mask::Mask;
285280

286281
use crate::binaryview::view::BinaryView;

0 commit comments

Comments
 (0)