@@ -159,10 +159,9 @@ pub fn hashless_setup_iterative(c: &mut Criterion) {
159159 )
160160 } ) ;
161161
162- group. bench_with_input (
162+ group. bench_function (
163163 BenchmarkId :: new ( "IFT optimal iterative" , size) ,
164- & size,
165- |b, & size| {
164+ |b| {
166165 b. iter_batched (
167166 // Setup: create values for each benchmark iteration
168167 || {
@@ -183,10 +182,9 @@ pub fn hashless_setup_iterative(c: &mut Criterion) {
183182 )
184183 } ,
185184 ) ;
186- group. bench_with_input (
185+ group. bench_function (
187186 BenchmarkId :: new ( "IFT full iterative" , size) ,
188- & size,
189- |b, & size| {
187+ |b| {
190188 b. iter_batched (
191189 // Setup: create values for each benchmark iteration
192190 || {
@@ -229,10 +227,9 @@ pub fn hashless_setup_batch(c: &mut Criterion) {
229227 BatchSize :: SmallInput ,
230228 )
231229 } ) ;
232- group. bench_with_input (
230+ group. bench_function (
233231 BenchmarkId :: new ( "IFT optimal batch" , size) ,
234- & size,
235- |b, & size| {
232+ |b| {
236233 b. iter_batched (
237234 // Setup: create values for each benchmark iteration
238235 || {
@@ -252,10 +249,9 @@ pub fn hashless_setup_batch(c: &mut Criterion) {
252249 )
253250 } ,
254251 ) ;
255- group. bench_with_input (
252+ group. bench_function (
256253 BenchmarkId :: new ( "IFT full batch" , size) ,
257- & size,
258- |b, & size| {
254+ |b| {
259255 b. iter_batched (
260256 // Setup: create values for each benchmark iteration
261257 || {
@@ -330,10 +326,9 @@ fn tree_hash_batch_setup_shootout(c: &mut Criterion) {
330326 )
331327 } ,
332328 ) ;
333- group. bench_with_input (
329+ group. bench_function (
334330 BenchmarkId :: new ( "IFT optimal batch poseidon" , size) ,
335- & size,
336- |b, & size| {
331+ |b| {
337332 b. iter_batched (
338333 // Setup: create values for each benchmark iteration
339334 || {
@@ -353,10 +348,9 @@ fn tree_hash_batch_setup_shootout(c: &mut Criterion) {
353348 )
354349 } ,
355350 ) ;
356- group. bench_with_input (
351+ group. bench_function (
357352 BenchmarkId :: new ( "IFT optimal batch light-poseidon" , size) ,
358- & size,
359- |b, & size| {
353+ |b| {
360354 b. iter_batched (
361355 // Setup: create values for each benchmark iteration
362356 || {
@@ -376,10 +370,9 @@ fn tree_hash_batch_setup_shootout(c: &mut Criterion) {
376370 )
377371 } ,
378372 ) ;
379- group. bench_with_input (
373+ group. bench_function (
380374 BenchmarkId :: new ( "IFT full batch poseidon" , size) ,
381- & size,
382- |b, & size| {
375+ |b| {
383376 b. iter_batched (
384377 // Setup: create values for each benchmark iteration
385378 || {
@@ -399,10 +392,9 @@ fn tree_hash_batch_setup_shootout(c: &mut Criterion) {
399392 )
400393 } ,
401394 ) ;
402- group. bench_with_input (
395+ group. bench_function (
403396 BenchmarkId :: new ( "IFT full batch light-poseidon" , size) ,
404- & size,
405- |b, & size| {
397+ |b| {
406398 b. iter_batched (
407399 // Setup: create values for each benchmark iteration
408400 || {
@@ -434,10 +426,9 @@ pub fn proof_gen_shootout(c: &mut Criterion) {
434426 let data_source = & data_table[ 0 ..size as usize ] ;
435427 // let data_stream = HashMockStream::seeded_stream(size as u64);
436428 // let chunk_vec = data_stream.take(size as usize).collect::<Vec<[u8; 32]>>();
437- group. bench_with_input (
429+ group. bench_function (
438430 BenchmarkId :: new ( "Lean IMT + ift_pos proof generation" , size) ,
439- & size,
440- |b, & _size| {
431+ |b, | {
441432 b. iter_batched (
442433 // Setup: create values for each benchmark iteration
443434 || {
@@ -454,10 +445,9 @@ pub fn proof_gen_shootout(c: &mut Criterion) {
454445 )
455446 } ,
456447 ) ;
457- group. bench_with_input (
448+ group. bench_function (
458449 BenchmarkId :: new ( "Lean IMT + light-pos proof generation" , size) ,
459- & size,
460- |b, & _size| {
450+ |b, | {
461451 b. iter_batched (
462452 // Setup: create values for each benchmark iteration
463453 || {
@@ -474,10 +464,9 @@ pub fn proof_gen_shootout(c: &mut Criterion) {
474464 )
475465 } ,
476466 ) ;
477- group. bench_with_input (
467+ group. bench_function (
478468 BenchmarkId :: new ( "IFT full + ift-pos proof generation" , size) ,
479- & size,
480- |b, & _size| {
469+ |b| {
481470 b. iter_batched (
482471 // Setup: create values for each benchmark iteration
483472 || {
@@ -488,7 +477,7 @@ pub fn proof_gen_shootout(c: &mut Criterion) {
488477 . map ( |chunk| bytes_le_to_fr ( & chunk) . 0 )
489478 . collect ( ) ;
490479 let mut tree = FullMerkleTree :: < PoseidonHash > :: new (
491- 7 ,
480+ size . ilog2 ( ) as usize + 1 ,
492481 Fr :: default ( ) ,
493482 FullMerkleConfig :: default ( ) ,
494483 )
@@ -502,10 +491,9 @@ pub fn proof_gen_shootout(c: &mut Criterion) {
502491 )
503492 } ,
504493 ) ;
505- group. bench_with_input (
494+ group. bench_function (
506495 BenchmarkId :: new ( "IFT full + light-pos proof generation" , size) ,
507- & size,
508- |b, & _size| {
496+ |b, | {
509497 b. iter_batched (
510498 // Setup: create values for each benchmark iteration
511499 || {
@@ -516,7 +504,7 @@ pub fn proof_gen_shootout(c: &mut Criterion) {
516504 . map ( |chunk| bytes_le_to_fr ( & chunk) . 0 )
517505 . collect ( ) ;
518506 let mut tree = FullMerkleTree :: < BenchyLightPosHasher > :: new (
519- 7 ,
507+ size . ilog2 ( ) as usize + 1 ,
520508 Fr :: default ( ) ,
521509 FullMerkleConfig :: default ( ) ,
522510 )
@@ -530,17 +518,16 @@ pub fn proof_gen_shootout(c: &mut Criterion) {
530518 )
531519 } ,
532520 ) ;
533- group. bench_with_input (
521+ group. bench_function (
534522 BenchmarkId :: new ( "IFT optimal + ift-pos proof generation" , size) ,
535- & size,
536- |b, & _size| {
523+ |b, | {
537524 b. iter_batched (
538525 // Setup: create values for each benchmark iteration
539526 || {
540527 let fr_slice = & fr_table[ 0 ..size as usize ] ;
541528 let fr_iter = fr_slice. iter ( ) . copied ( ) ;
542529 let mut tree = OptimalMerkleTree :: < PoseidonHash > :: new (
543- 7 ,
530+ size . ilog2 ( ) as usize + 1 ,
544531 Fr :: default ( ) ,
545532 OptimalMerkleConfig :: default ( ) ,
546533 )
@@ -554,17 +541,16 @@ pub fn proof_gen_shootout(c: &mut Criterion) {
554541 )
555542 } ,
556543 ) ;
557- group. bench_with_input (
544+ group. bench_function (
558545 BenchmarkId :: new ( "IFT optimal + light-pos proof generation" , size) ,
559- & size,
560- |b, & _size| {
546+ |b, | {
561547 b. iter_batched (
562548 // Setup: create values for each benchmark iteration
563549 || {
564550 let fr_slice = & fr_table[ 0 ..size as usize ] ;
565551 let fr_iter = fr_slice. iter ( ) . copied ( ) ;
566552 let mut tree = OptimalMerkleTree :: < BenchyLightPosHasher > :: new (
567- 7 ,
553+ size . ilog2 ( ) as usize + 1 ,
568554 Fr :: default ( ) ,
569555 OptimalMerkleConfig :: default ( ) ,
570556 )
@@ -654,7 +640,7 @@ pub fn verification_shootout(c: &mut Criterion) {
654640 . map ( |chunk| bytes_le_to_fr ( & chunk) . 0 )
655641 . collect ( ) ;
656642 let mut tree = FullMerkleTree :: < BenchyLightPosHasher > :: new (
657- 7 ,
643+ size . ilog2 ( ) as usize + 1 ,
658644 Fr :: default ( ) ,
659645 FullMerkleConfig :: default ( ) ,
660646 )
@@ -684,7 +670,7 @@ pub fn verification_shootout(c: &mut Criterion) {
684670 . map ( |chunk| bytes_le_to_fr ( & chunk) . 0 )
685671 . collect ( ) ;
686672 let mut tree = FullMerkleTree :: < PoseidonHash > :: new (
687- 7 ,
673+ size . ilog2 ( ) as usize + 1 ,
688674 Fr :: default ( ) ,
689675 FullMerkleConfig :: default ( ) ,
690676 )
@@ -714,7 +700,7 @@ pub fn verification_shootout(c: &mut Criterion) {
714700 . map ( |chunk| bytes_le_to_fr ( & chunk) . 0 )
715701 . collect ( ) ;
716702 let mut tree = OptimalMerkleTree :: < BenchyLightPosHasher > :: new (
717- 7 ,
703+ size . ilog2 ( ) as usize + 1 ,
718704 Fr :: default ( ) ,
719705 OptimalMerkleConfig :: default ( ) ,
720706 )
@@ -744,7 +730,7 @@ pub fn verification_shootout(c: &mut Criterion) {
744730 . map ( |chunk| bytes_le_to_fr ( & chunk) . 0 )
745731 . collect ( ) ;
746732 let mut tree = OptimalMerkleTree :: < PoseidonHash > :: new (
747- 7 ,
733+ size . ilog2 ( ) as usize + 1 ,
748734 Fr :: default ( ) ,
749735 OptimalMerkleConfig :: default ( ) ,
750736 )
0 commit comments