@@ -304,7 +304,7 @@ pub fn run_aggregation_benchmark(topology: &AggregationTopology, overlap: usize,
304304
305305 let n_sigs = count_signers ( topology, overlap) ;
306306
307- let cache = read_benchmark_signers_cache ( ) ;
307+ let cache = get_benchmark_signers_cache ( ) ;
308308 assert ! ( cache. len( ) >= n_sigs) ;
309309 let paired: Vec < _ > = ( 0 ..n_sigs)
310310 . into_par_iter ( )
@@ -334,3 +334,50 @@ pub fn run_aggregation_benchmark(topology: &AggregationTopology, overlap: usize,
334334 let message = message_for_benchmark ( ) ;
335335 crate :: verify_aggregation ( & aggregated_sigs, & message, BENCHMARK_SLOT ) . unwrap ( ) ;
336336}
337+
338+ #[ test]
339+ #[ ignore]
340+ fn test_aggregation_throughput_per_num_xmss ( ) {
341+ let log_inv_rate = 1 ;
342+ precompute_dft_twiddles :: < F > ( 1 << 24 ) ;
343+ init_aggregation_bytecode ( ) ;
344+ let _ = get_aggregation_bytecode ( ) ;
345+ let mut num_xmss_and_time = vec ! [ ] ;
346+ let mut indexes = vec ! [ ] ;
347+ for i in 1 ..100 {
348+ indexes. push ( i * 10 ) ;
349+ }
350+ for i in 50 ..100 {
351+ indexes. push ( i * 20 ) ;
352+ }
353+ for i in 40 ..60 {
354+ indexes. push ( i * 50 ) ;
355+ }
356+ for num_xmss in indexes {
357+ let topology = AggregationTopology {
358+ raw_xmss : num_xmss,
359+ children : vec ! [ ] ,
360+ log_inv_rate,
361+ } ;
362+ let instant = Instant :: now ( ) ;
363+ run_aggregation_benchmark ( & topology, 0 , false ) ;
364+ let elapsed = instant. elapsed ( ) ;
365+ num_xmss_and_time. push ( ( num_xmss, elapsed. as_secs_f64 ( ) ) ) ;
366+ println ! (
367+ "{} XMSS -> {} XMSS/s" ,
368+ num_xmss,
369+ ( num_xmss as f64 / elapsed. as_secs_f64( ) ) . round( ) as usize
370+ ) ;
371+
372+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 1000 ) ) ;
373+
374+ let mut csv = String :: from ( "num_sigs,throughput (XMSS/s)\n " ) ;
375+ for & ( n, t) in & num_xmss_and_time {
376+ csv. push_str ( & format ! ( "{},{:.1}\n " , n, n as f64 / t) ) ;
377+ }
378+ let path = std:: path:: PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) ) . join ( "benchmarks/xmss_throughput.csv" ) ;
379+ std:: fs:: create_dir_all ( path. parent ( ) . unwrap ( ) ) . unwrap ( ) ;
380+ std:: fs:: write ( & path, & csv) . unwrap ( ) ;
381+ println ! ( "\n Wrote {}" , path. display( ) ) ;
382+ }
383+ }
0 commit comments