Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,3 @@ incremental = false
debug = false
debug-assertions = true
incremental = false

# This improved build times significantly for default common cases that we use locally
[profile.dev.package.vortex-fastlanes]
debug = false
55 changes: 37 additions & 18 deletions encodings/fastlanes/src/bitpacking/compute/compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,43 @@ where
+ FastLanesComparable<Bitpacked = <T as PhysicalPType>::Physical>,
<T as PhysicalPType>::Physical: BitPacking + NativePType + BitPackingCompare,
{
match operator {
CompareOperator::Eq => {
stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_eq(b), ctx)
}
CompareOperator::NotEq => {
stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| !a.is_eq(b), ctx)
}
CompareOperator::Lt => {
stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_lt(b), ctx)
}
CompareOperator::Lte => {
stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_le(b), ctx)
}
CompareOperator::Gt => {
stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_gt(b), ctx)
}
CompareOperator::Gte => {
stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_ge(b), ctx)
#[cfg(debug_assertions)]
{
// FastLanes expands `unchecked_unpack_cmp` by width, value type, and comparator type.
// In dev builds, using one function-pointer comparator type avoids multiplying that
// generated code and debug info by every comparison operator.
let cmp: fn(T, T) -> bool = match operator {
CompareOperator::Eq => T::is_eq,
CompareOperator::NotEq => T::is_ne,
CompareOperator::Lt => T::is_lt,
CompareOperator::Lte => T::is_le,
CompareOperator::Gt => T::is_gt,
CompareOperator::Gte => T::is_ge,
};
stream_compare_fused::<T, fn(T, T) -> bool>(lhs, rhs, nullability, cmp, ctx)
}

#[cfg(not(debug_assertions))]
{
match operator {
CompareOperator::Eq => {
stream_compare_fused::<T, _>(lhs, rhs, nullability, T::is_eq, ctx)
}
CompareOperator::NotEq => {
stream_compare_fused::<T, _>(lhs, rhs, nullability, T::is_ne, ctx)
}
CompareOperator::Lt => {
stream_compare_fused::<T, _>(lhs, rhs, nullability, T::is_lt, ctx)
}
CompareOperator::Lte => {
stream_compare_fused::<T, _>(lhs, rhs, nullability, T::is_le, ctx)
}
CompareOperator::Gt => {
stream_compare_fused::<T, _>(lhs, rhs, nullability, T::is_gt, ctx)
}
CompareOperator::Gte => {
stream_compare_fused::<T, _>(lhs, rhs, nullability, T::is_ge, ctx)
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions vortex-array/src/dtype/ptype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ pub trait NativePType:
/// Whether another instance of this type (`other`) is bitwise equal to `self`
fn is_eq(self, other: Self) -> bool;

/// Whether another instance of this type (`other`) is bitwise not equal to `self`
fn is_ne(self, other: Self) -> bool {
!self.is_eq(other)
}

/// Downcast the provided object to a type-specific instance.
fn downcast<V: PTypeDowncast>(visitor: V) -> V::Output<Self>;

Expand Down
Loading