| name | ix-benchmark |
| description | Benchmark and compare ix algorithm performance |
| disable-model-invocation | true |
Benchmark
Profile and compare algorithm performance across the ix workspace.
When to Use
When the user wants to know which algorithm is fastest, measure scaling behavior, or compare approaches.
Approach
- Use
std::time::Instant for wall-clock timing
- Run multiple iterations to get stable measurements
- Report mean, min, max, and standard deviation
- Compare algorithms on the same problem instance
Example Benchmarks
use std::time::Instant;
let start = Instant::now();
let result = expensive_operation();
let elapsed = start.elapsed();
eprintln!("Took {:?}", elapsed);
for method in ["sgd", "adam", "pso", "annealing"] {
let start = Instant::now();
eprintln!("{}: {:?}", method, start.elapsed());
}
Common Comparisons
- Optimization: SGD vs Adam vs PSO vs Annealing on standard test functions
- Search: A* vs Q* vs BFS — node expansions and wall time
- Clustering: K-Means vs DBSCAN on different data shapes
- Pipeline: Sequential vs parallel DAG execution speedup
Storing Results
Use ix-cache to persist benchmark results across sessions:
use ix_cache::store::Cache;
let cache = Cache::default_cache();
cache.set("bench:optimize:sphere:pso", &elapsed_ms);