File tree Expand file tree Collapse file tree
datafusion/functions-aggregate Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -222,16 +222,16 @@ fn approx_distinct_benchmark(c: &mut Criterion) {
222222 } )
223223 } ) ;
224224
225- // Boolean
226- let values = Arc :: new ( create_bool_array ( ) ) as ArrayRef ;
227- c. bench_function ( "approx_distinct bool bitmap" , |b| {
228- b. iter ( || {
229- let mut accumulator = prepare_accumulator ( DataType :: Boolean ) ;
230- accumulator
231- . update_batch ( std:: slice:: from_ref ( & values) )
232- . unwrap ( )
233- } )
234- } ) ;
225+ // // Boolean - commented out for main comparison (not supported on main)
226+ // let values = Arc::new(create_bool_array()) as ArrayRef;
227+ // c.bench_function("approx_distinct bool bitmap", |b| {
228+ // b.iter(|| {
229+ // let mut accumulator = prepare_accumulator(DataType::Boolean);
230+ // accumulator
231+ // .update_batch(std::slice::from_ref(&values))
232+ // .unwrap()
233+ // })
234+ // });
235235}
236236
237237criterion_group ! ( benches, approx_distinct_benchmark) ;
Original file line number Diff line number Diff line change @@ -228,8 +228,8 @@ impl Bitmap256Accumulator {
228228
229229 #[ inline]
230230 fn set_bit ( & mut self , value : u8 ) {
231- let word = ( value / 64 ) as usize ;
232- let bit = value % 64 ;
231+ let word = ( value >> 6 ) as usize ;
232+ let bit = value & 63 ;
233233 self . bitmap [ word] |= 1u64 << bit;
234234 }
235235
@@ -303,8 +303,8 @@ impl Bitmap256AccumulatorI8 {
303303 fn set_bit ( & mut self , value : i8 ) {
304304 // Convert i8 to u8 by reinterpreting bits
305305 let idx = value as u8 ;
306- let word = ( idx / 64 ) as usize ;
307- let bit = idx % 64 ;
306+ let word = ( idx >> 6 ) as usize ;
307+ let bit = idx & 63 ;
308308 self . bitmap [ word] |= 1u64 << bit;
309309 }
310310
You can’t perform that action at this time.
0 commit comments