lawsynth/crates/lawsynth-wasm/benches/trajectory_throughput.rs
caelum0x 8af85c6e28 style: format workspace to rustfmt.toml (use_small_heuristics = Max)
Bring the whole workspace into compliance with the repo's rustfmt config
(edition 2024, max_width 100, use_small_heuristics = "Max"), which had drifted
across many crates. Pure formatting — no logic changes; `cargo fmt --check` is
now clean and `cargo build --workspace` is green.
2026-08-18 16:59:40 +03:00

16 lines
593 B
Rust

use lawsynth_wasm::{Expression, WasmConfig, World, simulate_rk4};
use std::hint::black_box;
use std::time::Instant;
fn main() {
let world =
World::new(vec!["x".into()], vec![1.0], vec![Expression::parse("-x").unwrap()]).unwrap();
let start = Instant::now();
let mut samples = 0;
for _ in 0..100 {
let trajectory = simulate_rk4(&world, 0.0, 10.0, 0.01, &WasmConfig::default()).unwrap();
samples += trajectory.len();
black_box(trajectory);
}
println!("RK4 trajectories: {:.0} samples/s", samples as f64 / start.elapsed().as_secs_f64());
}