Skip to content

Commit

Permalink
2x3 fishnet bench
Browse files Browse the repository at this point in the history
  • Loading branch information
GraDje13 committed Aug 6, 2024
1 parent 0bb8b73 commit 624aa88
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions benches/cff_scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ fn kinematics_builder(n_indep_externals: usize, n_loops: usize) -> DefaultSample
}
}

fn load_helper(path: &str) -> Graph {
fn load_helper(path: &str, use_orientations: bool) -> Graph {
let (_, mut amplitude) = load_amplitude_output(path, true);
amplitude.amplitude_graphs[0].graph.generate_cff();

let export_settings = ExportSettings {
compile_cff: true,
compile_separate_orientations: false,
compile_cff: !use_orientations,
compile_separate_orientations: use_orientations,
gammaloop_compile_options: GammaloopCompileOptions {
use_asm: env::var("USE_ASM").is_ok(),
optimization_level: 3,
Expand All @@ -73,7 +73,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let mut group = c.benchmark_group("scalar cff benchmarks");

let triangle_graph = load_helper("TEST_AMPLITUDE_massless_scalar_triangle/GL_OUTPUT");
let triangle_graph = load_helper("TEST_AMPLITUDE_massless_scalar_triangle/GL_OUTPUT", false);
let triangle_sample = kinematics_builder(2, 1);

group.bench_function("Triangle", |b| {
Expand All @@ -84,7 +84,7 @@ fn criterion_benchmark(c: &mut Criterion) {
)
});

let box_graph = load_helper("TEST_AMPLITUDE_scalar_massless_box/GL_OUTPUT");
let box_graph = load_helper("TEST_AMPLITUDE_scalar_massless_box/GL_OUTPUT", false);
let box_sample = kinematics_builder(3, 1);

group.bench_function("Box", |b| {
Expand All @@ -95,7 +95,8 @@ fn criterion_benchmark(c: &mut Criterion) {
)
});

let double_triangle_graph = load_helper("TEST_AMPLITUDE_scalar_double_triangle/GL_OUTPUT");
let double_triangle_graph =
load_helper("TEST_AMPLITUDE_scalar_double_triangle/GL_OUTPUT", false);
let double_triangle_sample = kinematics_builder(1, 2);

group.bench_function("Double Triangle", |b| {
Expand All @@ -106,7 +107,7 @@ fn criterion_benchmark(c: &mut Criterion) {
)
});

let isopod_graph = load_helper("TEST_AMPLITUDE_scalar_isopod/GL_OUTPUT");
let isopod_graph = load_helper("TEST_AMPLITUDE_scalar_isopod/GL_OUTPUT", false);
let isopod_sample = kinematics_builder(2, 3);

group.bench_function("Isopod (Triangle-Box-Box)", |b| {
Expand All @@ -117,7 +118,7 @@ fn criterion_benchmark(c: &mut Criterion) {
)
});

let fishnet_2x2_graph = load_helper("TEST_AMPLITUDE_scalar_fishnet_2x2/GL_OUTPUT");
let fishnet_2x2_graph = load_helper("TEST_AMPLITUDE_scalar_fishnet_2x2/GL_OUTPUT", false);
let fishnet_2x2_sample = kinematics_builder(3, 4);

group.bench_function("Fishnet 2x2", |b| {
Expand All @@ -128,6 +129,17 @@ fn criterion_benchmark(c: &mut Criterion) {
)
});

let fishnet_2x3_graph = load_helper("TEST_AMPLITUDE_scalar_fishnet_2x3/GL_OUTPUT", true);
let fishnet_2x3_sample = kinematics_builder(3, 6);

group.bench_function("Fishnet 2x3", |b| {
b.iter_batched(
|| &fishnet_2x3_graph,
|graph| graph.evaluate_cff_expression(&fishnet_2x3_sample, 0),
criterion::BatchSize::LargeInput,
)
});

std::fs::remove_dir_all(COMPILED_DUMP).unwrap();
}

Expand Down

0 comments on commit 624aa88

Please sign in to comment.