mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-09-01 18:57:21 +00:00

* Update to rust 2024 edition * Fixes * Clean up imports * Cargo fmt again --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
14 lines
532 B
Rust
14 lines
532 B
Rust
use criterion::{Criterion, black_box, criterion_group, criterion_main};
|
|
use graph_craft::util::DEMO_ART;
|
|
fn compile_to_proto(c: &mut Criterion) {
|
|
use graph_craft::util::{compile, load_from_name};
|
|
let mut c = c.benchmark_group("Compile Network cold");
|
|
|
|
for name in DEMO_ART {
|
|
let network = load_from_name(name);
|
|
c.bench_function(name, |b| b.iter_batched(|| network.clone(), |network| compile(black_box(network)), criterion::BatchSize::SmallInput));
|
|
}
|
|
}
|
|
|
|
criterion_group!(benches, compile_to_proto);
|
|
criterion_main!(benches);
|