Files
foxhunt/tests/benches/simple_performance.rs
jgrusewski 6093eac7bf 🔧 Tonic 0.14 Upgrade: Auto-generated and build system changes
Wave 64-65 cleanup: Proto regeneration and build system updates from Tonic 0.12→0.14 upgrade

Files updated:
- Cargo.lock: Dependency resolution for Tonic 0.14.2
- All build.rs: Updated for tonic-prost-build
- Proto files: Regenerated with tonic-prost 0.14
- Examples/tests: Updated for new gRPC API

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 07:34:26 +02:00

41 lines
1.2 KiB
Rust

//! Simple Performance Test to validate benchmark infrastructure works
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use common::types::{Price, Quantity};
/// Simple benchmark to test that criterion framework is working
fn simple_benchmark(c: &mut Criterion) {
c.bench_function("simple_test", |b| {
b.iter(|| {
let x = black_box(42);
let y = black_box(24);
black_box(x + y)
})
});
}
/// Test that our imports work
fn test_imports_benchmark(c: &mut Criterion) {
c.bench_function("test_imports", |b| {
b.iter(|| {
// Test basic types
let price = black_box(
Price::new(100.0)
.map_err(|e| format!("Failed to create test price: {}", e))
.unwrap(),
);
let quantity = black_box(
Quantity::new(1000.0)
.map_err(|e| format!("Failed to create test quantity: {}", e))
.unwrap(),
);
// Simple calculation
black_box(price.as_f64() * quantity.as_f64())
})
});
}
criterion_group!(benches, simple_benchmark, test_imports_benchmark);
criterion_main!(benches);