Expand description
§cntryl-stress
Performance benchmarks for engineers who need trustworthy artifacts, not just timing numbers.
cntryl-stress is an opinionated Rust benchmarking framework for performance engineering loops. It keeps benchmark authoring low ceremony while producing structured artifacts, diagnostics, and gates that can support real optimization decisions.
The framework is designed around one core question:
- Can this benchmark row be trusted?
It helps answer that by recording raw samples, deriving summaries from measured samples only, preserving correctness counters, and calling out common benchmark-shape mistakes automatically.
Tier labels:
- Tier 1: hot path
- Tier 2: subsystem
- Tier 3: system
- Tier 4: integration
- Tier 5: saturation/scaling
- Tier 6: soak/endurance
The common benchmark body is intentionally small:
use cntryl_stress::{black_box, stress, LogicalUnit, OperationOutcome, StressContext};
#[stress(tier = 1)]
fn parse_hot_path(ctx: &mut StressContext) {
let header = b"content-type:application/json";
ctx.measure("colon lookup", || black_box(header.iter().position(|byte| *byte == b':')));
}
#[stress(tier = 3)]
fn process_batch(ctx: &mut StressContext) {
let records = [1_u64, 2, 3];
ctx.measure_outcome("process batch", LogicalUnit::new("record"), || {
black_box(records.iter().sum::<u64>());
OperationOutcome::success(records.len() as u64)
});
}A harness = false benchmark binary ends with
cntryl_stress::stress_main!();.
Re-exports§
pub use artifact::RunProfile;pub use artifact::TrustClass as BenchmarkRole;pub use context::LogicalUnit;pub use context::OperationOutcome;pub use context::StressContext;pub use runner::StressRunner;
Modules§
- artifact
- Raw-sample result types and current artifact helpers.
- context
- Benchmark context for named measurements, workload facts, and correctness counters.
- prelude
- Prelude module for benchmark files.
- reporting
- Pluggable reporters for current stress artifacts.
- runner
- Stress runner that records raw samples and derives current artifacts.
Macros§
- stress_
allocator - Install the stress allocation-counting global allocator.
- stress_
main - Generate a
mainfunction for stress benchmark binaries.
Structs§
- Stress
Error - Error returned by a stress benchmark function.
- Stress
Runner Config - Configuration for one stress suite run.
- Stress
Runner Options - Options for programmatic execution of registered benchmarks.
Functions§
- black_
box - An identity function that hints to the compiler to be maximally pessimistic about what
black_boxcould do.
Type Aliases§
- Stress
Result - Result returned by fallible stress benchmarks.
Attribute Macros§
- stress
- Mark a function as a stress benchmark.