From 8b3b046abf1f37ca5ee587db7a9af98b42d4a9e4 Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Fri, 19 Jun 2026 11:09:40 +0100 Subject: [PATCH 1/2] Reduce vortex-fastlanes debug symbolx size without config Signed-off-by: Adam Gutglick --- Cargo.toml | 4 -- .../src/bitpacking/compute/compare.rs | 55 +++++++++++++------ vortex-array/src/dtype/ptype.rs | 6 ++ 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8cf6e741a8b..c25c634eae5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 diff --git a/encodings/fastlanes/src/bitpacking/compute/compare.rs b/encodings/fastlanes/src/bitpacking/compute/compare.rs index d5c50751bae..241fa0056b9 100644 --- a/encodings/fastlanes/src/bitpacking/compute/compare.rs +++ b/encodings/fastlanes/src/bitpacking/compute/compare.rs @@ -80,24 +80,43 @@ where + FastLanesComparable::Physical>, ::Physical: BitPacking + NativePType + BitPackingCompare, { - match operator { - CompareOperator::Eq => { - stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_eq(b), ctx) - } - CompareOperator::NotEq => { - stream_compare_fused::(lhs, rhs, nullability, |a, b| !a.is_eq(b), ctx) - } - CompareOperator::Lt => { - stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_lt(b), ctx) - } - CompareOperator::Lte => { - stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_le(b), ctx) - } - CompareOperator::Gt => { - stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_gt(b), ctx) - } - CompareOperator::Gte => { - stream_compare_fused::(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 => NativePType::is_eq, + CompareOperator::NotEq => NativePType::is_ne, + CompareOperator::Lt => NativePType::is_lt, + CompareOperator::Lte => NativePType::is_le, + CompareOperator::Gt => NativePType::is_gt, + CompareOperator::Gte => NativePType::is_ge, + }; + stream_compare_fused:: bool>(lhs, rhs, nullability, cmp, ctx) + } + + #[cfg(not(debug_assertions))] + { + match operator { + CompareOperator::Eq => { + stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_eq(b), ctx) + } + CompareOperator::NotEq => { + stream_compare_fused::(lhs, rhs, nullability, |a, b| !a.is_eq(b), ctx) + } + CompareOperator::Lt => { + stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_lt(b), ctx) + } + CompareOperator::Lte => { + stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_le(b), ctx) + } + CompareOperator::Gt => { + stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_gt(b), ctx) + } + CompareOperator::Gte => { + stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_ge(b), ctx) + } } } } diff --git a/vortex-array/src/dtype/ptype.rs b/vortex-array/src/dtype/ptype.rs index ab443618d66..5a86364fe80 100644 --- a/vortex-array/src/dtype/ptype.rs +++ b/vortex-array/src/dtype/ptype.rs @@ -152,6 +152,12 @@ 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(visitor: V) -> V::Output; From 31b9d58928347352d1e7a9c90358693ecb83e1ee Mon Sep 17 00:00:00 2001 From: Adam Gutglick Date: Fri, 19 Jun 2026 11:39:42 +0100 Subject: [PATCH 2/2] . Signed-off-by: Adam Gutglick --- .../src/bitpacking/compute/compare.rs | 24 +++++++++---------- vortex-array/src/dtype/ptype.rs | 3 +-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/encodings/fastlanes/src/bitpacking/compute/compare.rs b/encodings/fastlanes/src/bitpacking/compute/compare.rs index 241fa0056b9..d69e098c594 100644 --- a/encodings/fastlanes/src/bitpacking/compute/compare.rs +++ b/encodings/fastlanes/src/bitpacking/compute/compare.rs @@ -86,12 +86,12 @@ where // 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 => NativePType::is_eq, - CompareOperator::NotEq => NativePType::is_ne, - CompareOperator::Lt => NativePType::is_lt, - CompareOperator::Lte => NativePType::is_le, - CompareOperator::Gt => NativePType::is_gt, - CompareOperator::Gte => NativePType::is_ge, + 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:: bool>(lhs, rhs, nullability, cmp, ctx) } @@ -100,22 +100,22 @@ where { match operator { CompareOperator::Eq => { - stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_eq(b), ctx) + stream_compare_fused::(lhs, rhs, nullability, T::is_eq, ctx) } CompareOperator::NotEq => { - stream_compare_fused::(lhs, rhs, nullability, |a, b| !a.is_eq(b), ctx) + stream_compare_fused::(lhs, rhs, nullability, T::is_ne, ctx) } CompareOperator::Lt => { - stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_lt(b), ctx) + stream_compare_fused::(lhs, rhs, nullability, T::is_lt, ctx) } CompareOperator::Lte => { - stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_le(b), ctx) + stream_compare_fused::(lhs, rhs, nullability, T::is_le, ctx) } CompareOperator::Gt => { - stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_gt(b), ctx) + stream_compare_fused::(lhs, rhs, nullability, T::is_gt, ctx) } CompareOperator::Gte => { - stream_compare_fused::(lhs, rhs, nullability, |a, b| a.is_ge(b), ctx) + stream_compare_fused::(lhs, rhs, nullability, T::is_ge, ctx) } } } diff --git a/vortex-array/src/dtype/ptype.rs b/vortex-array/src/dtype/ptype.rs index 5a86364fe80..e2565147ac3 100644 --- a/vortex-array/src/dtype/ptype.rs +++ b/vortex-array/src/dtype/ptype.rs @@ -152,10 +152,9 @@ 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) + !self.is_eq(other) } /// Downcast the provided object to a type-specific instance.