File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,15 @@ use vortex_buffer::BitBuffer;
1212use vortex_buffer:: BitBufferMut ;
1313
1414fn main ( ) {
15+ // Pre-warm CPUID feature detection so the one-time probe cost is never
16+ // included in any benchmark iteration.
17+ #[ cfg( target_arch = "x86_64" ) ]
18+ {
19+ let _ = is_x86_feature_detected ! ( "avx2" ) ;
20+ let _ = is_x86_feature_detected ! ( "avx512f" ) ;
21+ let _ = is_x86_feature_detected ! ( "avx512vpopcntdq" ) ;
22+ }
23+
1524 divan:: main ( ) ;
1625}
1726
@@ -166,9 +175,6 @@ fn slice_arrow_buffer(bencher: Bencher, length: usize) {
166175#[ divan:: bench( args = INPUT_SIZE ) ]
167176fn true_count_vortex_buffer ( bencher : Bencher , length : usize ) {
168177 let buffer = BitBuffer :: from_iter ( ( 0 ..length) . map ( true_count_pattern) ) ;
169- // Preload cpuid flags, one slow run that does feature detection skews sampling thus leading to way too few runs when feature detection kicks in.
170- #[ cfg( target_arch = "x86_64" ) ]
171- let _ = is_x86_feature_detected ! ( "avx2" ) ;
172178
173179 bencher
174180 . with_inputs ( || & buffer)
You can’t perform that action at this time.
0 commit comments