Skip to content

Commit 532f345

Browse files
committed
but how is perf like this
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
1 parent aefa6b8 commit 532f345

1 file changed

Lines changed: 25 additions & 30 deletions

File tree

  • encodings/fastlanes/src/bitpacking/compute

encodings/fastlanes/src/bitpacking/compute/compare.rs

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ where
8080
+ FastLanesComparable<Bitpacked = <T as PhysicalPType>::Physical>,
8181
<T as PhysicalPType>::Physical: BitPacking + NativePType + BitPackingCompare,
8282
{
83-
#[cfg(debug_assertions)]
83+
// #[cfg(debug_assertions)]
8484
{
8585
// FastLanes expands `unchecked_unpack_cmp` by width, value type, and comparator type.
8686
// In dev builds, using one function-pointer comparator type avoids multiplying that
8787
// generated code and debug info by every comparison operator.
8888
let cmp: fn(T, T) -> bool = match operator {
8989
CompareOperator::Eq => NativePType::is_eq,
90-
CompareOperator::NotEq => not_eq::<T>,
90+
CompareOperator::NotEq => |a, b| !NativePType::is_eq(a, b),
9191
CompareOperator::Lt => NativePType::is_lt,
9292
CompareOperator::Lte => NativePType::is_le,
9393
CompareOperator::Gt => NativePType::is_gt,
@@ -96,34 +96,29 @@ where
9696
stream_compare_fused::<T, fn(T, T) -> bool>(lhs, rhs, nullability, cmp, ctx)
9797
}
9898

99-
#[cfg(not(debug_assertions))]
100-
{
101-
match operator {
102-
CompareOperator::Eq => {
103-
stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_eq(b), ctx)
104-
}
105-
CompareOperator::NotEq => {
106-
stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| !a.is_eq(b), ctx)
107-
}
108-
CompareOperator::Lt => {
109-
stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_lt(b), ctx)
110-
}
111-
CompareOperator::Lte => {
112-
stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_le(b), ctx)
113-
}
114-
CompareOperator::Gt => {
115-
stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_gt(b), ctx)
116-
}
117-
CompareOperator::Gte => {
118-
stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_ge(b), ctx)
119-
}
120-
}
121-
}
122-
}
123-
124-
#[cfg(debug_assertions)]
125-
fn not_eq<T: NativePType>(lhs: T, rhs: T) -> bool {
126-
!lhs.is_eq(rhs)
99+
// #[cfg(not(debug_assertions))]
100+
// {
101+
// match operator {
102+
// CompareOperator::Eq => {
103+
// stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_eq(b), ctx)
104+
// }
105+
// CompareOperator::NotEq => {
106+
// stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| !a.is_eq(b), ctx)
107+
// }
108+
// CompareOperator::Lt => {
109+
// stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_lt(b), ctx)
110+
// }
111+
// CompareOperator::Lte => {
112+
// stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_le(b), ctx)
113+
// }
114+
// CompareOperator::Gt => {
115+
// stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_gt(b), ctx)
116+
// }
117+
// CompareOperator::Gte => {
118+
// stream_compare_fused::<T, _>(lhs, rhs, nullability, |a, b| a.is_ge(b), ctx)
119+
// }
120+
// }
121+
// }
127122
}
128123

129124
#[cfg(test)]

0 commit comments

Comments
 (0)