(group: &mut BenchmarkGroup<WallTime>, contents: String)
| 69 | } |
| 70 | |
| 71 | pub fn benchmark_pystone(group: &mut BenchmarkGroup<WallTime>, contents: String) { |
| 72 | // Default is 50_000. This takes a while, so reduce it to 30k. |
| 73 | for idx in (10_000..=30_000).step_by(10_000) { |
| 74 | let code_with_loops = format!("LOOPS = {idx}\n{contents}"); |
| 75 | let code_str = code_with_loops.as_str(); |
| 76 | |
| 77 | group.throughput(Throughput::Elements(idx as u64)); |
| 78 | group.bench_function(BenchmarkId::new("cpython", idx), |b| { |
| 79 | bench_cpython_code(b, code_str) |
| 80 | }); |
| 81 | group.bench_function(BenchmarkId::new("rustpython", idx), |b| { |
| 82 | bench_rustpython_code(b, "pystone", code_str) |
| 83 | }); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | pub fn criterion_benchmark(c: &mut Criterion) { |
| 88 | let benchmark_dir = Path::new("./benches/benchmarks/"); |
no test coverage detected