Download node-graph/interpreted-executor/benches/run_once.rs from openfree/graphite2: direct link, hf CLI and curl.
- Browser
- Download file 690 Bytes
-
https://huggingface.co/spaces/openfree/graphite2/resolve/main/node-graph/interpreted-executor/benches/run_once.rs
- Command line
-
hf download hf://spaces/openfree/graphite2/node-graph/interpreted-executor/benches/run_once.rs
-
curl -L -o run_once.rs https://huggingface.co/spaces/openfree/graphite2/resolve/main/node-graph/interpreted-executor/benches/run_once.rs
690 Bytes
| mod benchmark_util; | |
| use benchmark_util::{bench_for_each_demo, setup_network}; | |
| use criterion::{Criterion, criterion_group, criterion_main}; | |
| use graphene_std::Context; | |
| fn run_once(c: &mut Criterion) { | |
| let mut group = c.benchmark_group("Run Once"); | |
| let context: Context = None; | |
| bench_for_each_demo(&mut group, |name, g| { | |
| g.bench_function(name, |b| { | |
| b.iter_batched( | |
| || setup_network(name), | |
| |(executor, _)| futures::executor::block_on(executor.tree().eval_tagged_value(executor.output(), criterion::black_box(context.clone()))).unwrap(), | |
| criterion::BatchSize::SmallInput, | |
| ) | |
| }); | |
| }); | |
| group.finish(); | |
| } | |
| criterion_group!(benches, run_once); | |
| criterion_main!(benches); | |