/ src / main.rs
main.rs
 1  use {
 2      anyhow::anyhow,
 3      criterion::{
 4          criterion_group,
 5          criterion_main,
 6          AxisScale,
 7          BenchmarkId,
 8          Criterion,
 9          PlotConfiguration,
10      },
11      my_whatever::MyWhatever,
12      std::{
13          error::Error as StdError,
14          hint::black_box as bb,
15          mem::size_of,
16      },
17  };
18  
19  mod helpers; // Must be before all modules that use its macros.
20  
21  mod create_type;
22  
23  mod dyn_trait_obj;
24  
25  
26  fn criterion_config() -> Criterion
27  {
28      #[cfg(feature = "noisy_PC")]
29      {
30          // Note: Don't use this for comparing changes to the source-code (to either these benches
31          // or the libs) that are expected to have only minor effects on performance.  Only use for
32          // comparing successive runs of the same source-code, or for changes expected to have
33          // major effects, on your PC that is "noisy" due to various other processes running, due
34          // to your variable CPU-frequency and fan management, etc.
35          Criterion::default().sample_size(1_000).noise_threshold(0.10).significance_level(0.01)
36      }
37      #[cfg(not(feature = "noisy_PC"))]
38      {
39          Criterion::default()
40      }
41  }
42  
43  
44  criterion_main!(create_type::group, dyn_trait_obj::group);