File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,6 +188,34 @@ fn sort_unique_locale(bencher: Bencher, num_lines: usize) {
188188 } ) ;
189189}
190190
191+ /// Benchmark sorting with very long lines exceeding START_BUFFER_SIZE (8000 bytes)
192+ #[ divan:: bench( args = [ 16_0000 ] ) ]
193+ fn sort_long_line ( bencher : Bencher , line_size : usize ) {
194+ // Create files with very long lines (16KB) to test buffer handling
195+ let mut data_a = vec ! [ b'b' ; line_size] ;
196+ data_a. push ( b'\n' ) ;
197+
198+ let mut data_b = vec ! [ b'a' ; line_size] ;
199+ data_b. push ( b'\n' ) ;
200+
201+ let file_a = setup_test_file ( & data_a) ;
202+ let file_b = setup_test_file ( & data_b) ;
203+ let output_file = NamedTempFile :: new ( ) . unwrap ( ) ;
204+ let output_path = output_file. path ( ) . to_str ( ) . unwrap ( ) ;
205+
206+ bencher. bench ( || {
207+ black_box ( run_util_function (
208+ uumain,
209+ & [
210+ file_a. to_str ( ) . unwrap ( ) ,
211+ file_b. to_str ( ) . unwrap ( ) ,
212+ "-o" ,
213+ output_path,
214+ ] ,
215+ ) ) ;
216+ } ) ;
217+ }
218+
191219fn main ( ) {
192220 divan:: main ( ) ;
193221}
You can’t perform that action at this time.
0 commit comments