This repository was archived by the owner on Oct 17, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,19 @@ version = "0.1.0"
44authors = [" Heinz N. Gies <heinz@licenser.net>" ]
55edition = " 2018"
66
7- # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8-
7+ [features ]
8+ default = [" cpb" ]
9+ cpb = []
910
1011[dev-dependencies ]
1112proptest = " 0.10"
1213criterion = " 0.3"
1314mimalloc = " 0.1"
1415core_affinity = " *"
1516
17+ [target .'cfg(any(target_arch = "x86_64", target_arch = "x86"))' .dev-dependencies ]
18+ criterion-cycles-per-byte = " 0.1"
19+
1620[[bench ]]
1721name = " criterion_bench"
1822harness = false
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ extern crate core_affinity;
22#[ macro_use]
33extern crate criterion;
44
5+ #[ cfg( all( any( target_arch = "x86_64" , target_arch = "x86" ) , feature = "cpb" ) ) ]
6+ use criterion_cycles_per_byte:: CyclesPerByte ;
7+
58use mimalloc:: MiMalloc ;
69#[ global_allocator]
710static GLOBAL : MiMalloc = MiMalloc ;
@@ -47,5 +50,11 @@ fn bench_all<T: Measurement>(c: &mut Criterion<T>) {
4750 bench_file ( c, "ascii_sample_ok" , true ) ;
4851}
4952
50- criterion_group ! ( benches, bench_all) ;
53+ #[ cfg( all( any( target_arch = "x86_64" , target_arch = "x86" ) , feature = "cpb" ) ) ]
54+ criterion_group ! {
55+ name = benches;
56+ config = Criterion :: default ( ) . with_measurement( CyclesPerByte ) ;
57+ targets = bench_all
58+ }
59+
5160criterion_main ! ( benches) ;
You can’t perform that action at this time.
0 commit comments