Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GraphiteEditor/Graphite
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7ae391878e274bae4880294b785527a8e60cc10f
Choose a base ref
..
head repository: GraphiteEditor/Graphite
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 49b03307ef78444a28503798479ecfacbdab36ec
Choose a head ref
Showing with 4 additions and 7 deletions.
  1. +4 −7 node-graph/graph-craft/benches/compile_demo_art.rs
11 changes: 4 additions & 7 deletions node-graph/graph-craft/benches/compile_demo_art.rs
Original file line number Diff line number Diff line change
@@ -18,8 +18,8 @@ fn compile(network: NodeNetwork) -> ProtoNetwork {
compiler.compile_single(network).unwrap()
}

#[cfg(all(not(feature = "criterion"), feature = "iai"))]
fn load_from_name(name: &str) -> NodeNetwork {
let content = std::fs::read(&path).expect("failed to read file");
let content = std::fs::read(&format!("../../demo-artwork/{name}.graphite")).expect("failed to read file");
let network = load_network(std::str::from_utf8(&content).unwrap());
let content = std::str::from_utf8(&content).unwrap();
@@ -39,14 +39,11 @@ fn compile_to_proto(c: &mut Criterion) {
}
}

#[cfg(all(not(feature = "criterion"), feature = "iai"))]
#[cfg_attr(all(feature = "iai", not(feature = "criterion")), library_benchmark)]
#[cfg_attr(all(feature = "iai", not(feature="criterion")), benches::with_setup(args = ["isometric-fountain", "painted-dreams", "procedural-string-lights", "red-dress", "valley-of-spires"], setup = load_from_name))]
fn iai_compile_to_proto() {
let artworks = glob::glob("../../demo-artwork/*.graphite").expect("failed to read glob pattern");
for path in artworks {
let Ok(path) = path else { continue };
bench_compile(path);
}
fn iai_compile_to_proto(input: NodeNetwork) {
black_box(compile(input));
}

#[cfg(feature = "criterion")]