@@ -181,15 +181,15 @@ fn reserve_empty_page(c: &mut Criterion) {
181
181
let mut group = c. benchmark_group ( "reserve_empty_page" ) ;
182
182
group. throughput ( Throughput :: Bytes ( PAGE_DATA_SIZE as _ ) ) ;
183
183
group. bench_function ( "leave_uninit" , |b| {
184
- let pool = PagePool :: default ( ) ;
184
+ let pool = PagePool :: new_for_test ( ) ;
185
185
let mut pages = Pages :: default ( ) ;
186
186
b. iter ( || {
187
187
let _ = black_box ( pages. reserve_empty_page ( & pool, RESERVE_SIZE ) ) ;
188
188
} ) ;
189
189
} ) ;
190
190
191
191
let fill_with_zeros = |_, _, pages : & mut Pages | {
192
- let pool = PagePool :: default ( ) ;
192
+ let pool = PagePool :: new_for_test ( ) ;
193
193
let page = pages. reserve_empty_page ( & pool, RESERVE_SIZE ) . unwrap ( ) ;
194
194
let page = pages. get_page_mut ( page) ;
195
195
unsafe { page. zero_data ( ) } ;
@@ -222,7 +222,7 @@ fn insert_one_page_fixed_len(c: &mut Criterion) {
222
222
rows_per_page :: < R > ( ) as u64 * mem:: size_of :: < R > ( ) as u64 ,
223
223
) ) ;
224
224
group. bench_function ( name, |b| {
225
- let pool = PagePool :: default ( ) ;
225
+ let pool = PagePool :: new_for_test ( ) ;
226
226
let mut pages = Pages :: default ( ) ;
227
227
// `0xa5` is the alternating bit pattern, which makes incorrect accesses obvious.
228
228
insert_one_page_worth_fixed_len ( & pool, & mut pages, visitor, & R :: from_u64 ( 0xa5a5a5a5_a5a5a5a5 ) ) ;
@@ -283,7 +283,7 @@ fn delete_one_page_fixed_len(c: &mut Criterion) {
283
283
} ;
284
284
iter_time_with (
285
285
b,
286
- & mut ( Pages :: default ( ) , PagePool :: default ( ) ) ,
286
+ & mut ( Pages :: default ( ) , PagePool :: new_for_test ( ) ) ,
287
287
pre,
288
288
|ptrs, _, ( pages, _) | {
289
289
for ptr in ptrs {
@@ -315,7 +315,7 @@ fn retrieve_one_page_fixed_len(c: &mut Criterion) {
315
315
group. throughput ( Throughput :: Bytes ( rows_per_page as u64 * mem:: size_of :: < R > ( ) as u64 ) ) ;
316
316
317
317
group. bench_function ( name, |b| {
318
- let pool = PagePool :: default ( ) ;
318
+ let pool = PagePool :: new_for_test ( ) ;
319
319
let mut pages = Pages :: default ( ) ;
320
320
321
321
let ptrs = fill_page_with_fixed_len_collect_row_pointers (
@@ -367,7 +367,7 @@ fn insert_with_holes_fixed_len(c: &mut Criterion) {
367
367
group. throughput ( Throughput :: Bytes ( num_to_delete_in_bytes as u64 ) ) ;
368
368
369
369
group. bench_function ( delete_ratio. to_string ( ) , |b| {
370
- let pool = PagePool :: default ( ) ;
370
+ let pool = PagePool :: new_for_test ( ) ;
371
371
let mut pages = Pages :: default ( ) ;
372
372
373
373
let mut rng = StdRng :: seed_from_u64 ( 0xa5a5a5a5_a5a5a5a5 ) ;
@@ -437,7 +437,7 @@ fn copy_filter_fixed_len(c: &mut Criterion) {
437
437
let val = R :: from_u64 ( 0xdeadbeef_0badbeef ) ;
438
438
for keep_ratio in [ 0.1 , 0.25 , 0.5 , 0.75 , 0.9 , 1.0 ] {
439
439
let visitor = & NullVarLenVisitor ;
440
- let pool = PagePool :: default ( ) ;
440
+ let pool = PagePool :: new_for_test ( ) ;
441
441
let mut pages = Pages :: default ( ) ;
442
442
443
443
let num_pages = 16 ;
@@ -537,7 +537,7 @@ fn table_insert_one_row(c: &mut Criterion) {
537
537
let val = black_box ( val. to_product ( ) ) ;
538
538
539
539
// Insert before benching to alloc and fault in a page.
540
- let pool = PagePool :: default ( ) ;
540
+ let pool = PagePool :: new_for_test ( ) ;
541
541
let mut ctx = ( table, NullBlobStore ) ;
542
542
let ptr = ctx. 0 . insert ( & pool, & mut ctx. 1 , & val) . unwrap ( ) . 1 . pointer ( ) ;
543
543
let pre = |_, ( table, bs) : & mut ( Table , NullBlobStore ) | {
@@ -588,7 +588,7 @@ fn table_delete_one_row(c: &mut Criterion) {
588
588
let val = val. to_product ( ) ;
589
589
590
590
// Insert before benching to alloc and fault in a page.
591
- let mut ctx = ( table, NullBlobStore , PagePool :: default ( ) ) ;
591
+ let mut ctx = ( table, NullBlobStore , PagePool :: new_for_test ( ) ) ;
592
592
let insert = |_: u64 , ( table, bs, pool) : & mut ( Table , NullBlobStore , PagePool ) | {
593
593
table. insert ( pool, bs, & val) . unwrap ( ) . 1 . pointer ( )
594
594
} ;
@@ -637,7 +637,7 @@ fn table_extract_one_row(c: &mut Criterion) {
637
637
let mut table = make_table_for_row_type :: < R > ( name) ;
638
638
let val = val. to_product ( ) ;
639
639
640
- let pool = PagePool :: default ( ) ;
640
+ let pool = PagePool :: new_for_test ( ) ;
641
641
let mut blob_store = NullBlobStore ;
642
642
let row = black_box ( table. insert ( & pool, & mut blob_store, & val) . unwrap ( ) . 1 ) ;
643
643
group. bench_function ( name, |b| {
@@ -848,7 +848,7 @@ fn index_insert(c: &mut Criterion) {
848
848
same_ratio : f64 ,
849
849
) {
850
850
let make_row_move = & mut make_row;
851
- let pool = PagePool :: default ( ) ;
851
+ let pool = PagePool :: new_for_test ( ) ;
852
852
let ( tbl, index_id, num_same, _) =
853
853
make_table_with_same_ratio :: < R > ( & pool, make_row_move, num_rows, same_ratio, false ) ;
854
854
let mut ctx = ( tbl, NullBlobStore , pool) ;
@@ -905,7 +905,7 @@ fn index_seek(c: &mut Criterion) {
905
905
) {
906
906
let make_row_move = & mut make_row;
907
907
let ( tbl, index_id, num_same, num_diff) =
908
- make_table_with_same_ratio :: < R > ( & PagePool :: default ( ) , make_row_move, num_rows, same_ratio, unique) ;
908
+ make_table_with_same_ratio :: < R > ( & PagePool :: new_for_test ( ) , make_row_move, num_rows, same_ratio, unique) ;
909
909
910
910
group. bench_with_input (
911
911
bench_id_for_index ( name, num_rows, same_ratio, num_same, unique) ,
@@ -972,7 +972,7 @@ fn index_delete(c: &mut Criterion) {
972
972
same_ratio : f64 ,
973
973
) {
974
974
let make_row_move = & mut make_row;
975
- let pool = PagePool :: default ( ) ;
975
+ let pool = PagePool :: new_for_test ( ) ;
976
976
let ( mut tbl, index_id, num_same, _) =
977
977
make_table_with_same_ratio :: < R > ( & pool, make_row_move, num_rows, same_ratio, false ) ;
978
978
0 commit comments