RapidRecorder
A high-performance library for tracking internal variables in concurrent Rust applications.
Features
- High Performance: Minimal overhead in performance-critical code paths
- Thread-Safe: Safe for multi-threaded and parallel applications
- Configurable Sampling: Record values at specified intervals, or on every index change
- Flexible Indexing: Index recordings by time, step, run, or custom dimensions
Use Cases
- Recording thread-local and/or deeply-nested variables in performance-sensitive simulation code
- Tracking state in multi-threaded applications without disrupting execution flow
Usage Example
use *;
impl_rapid_recorder_named_usize!;
Benchmarks:
Run cargo run --example performance_test
Best Practices
Recommended Usage Patterns
- Single Index Management: Manage record indexes in a single thread, while adding readings from multiple threads
for i in 0..1000
- Different Sampling Rates: Use multiple groups for different sampling needs
let mut high_frequency_group = recorder.add_group;
let mut low_frequency_group = recorder.add_group;
- Multiple Index Dimensions: Track different types of indexes
let mut step_group = recorder.add_group;
let mut time_group = recorder.add_group;
Patterns to Avoid
- Multiple Values for Same Reading: Adding the same reading name multiple times per record from different threads
// Not recommended - only one value will be recorded and we can't even guarantee it was the last value
.into_par_iter.for_each;
- Distributing Primary Record Indexes: Creating new groups in parallel threads
// Not recommended - poor performance
.into_par_iter.for_each;