Performance Measurement Library
This library provides tools for measuring the time and memory complexity of code, supporting both synchronous and asynchronous operations. It is designed for developers who need to benchmark their code in multi-threaded or single-threaded environments.
Modules
common_collector: A common interface for both thetime&memorymodules, combining the functionality of botherror: Custom error handling types used across the library.memory: Functions and traits for memory complexity measurement.system_metrics: Structures and traits for collecting system-level metrics.thread_metrics: Data structures for holding thread-specific metric data.time: Functions and traits for time complexity measurement.time_handle: An abstraction for the time elapsed logic used across the library.utils: Utility functions used throughout the library.
Re-exports
The library re-exports the most commonly used traits and structs for easier access:
MemoryComplexityandMemoryMeasurementfor memory complexity measurement.TimeComplexityandTimeMeasurementfor time complexity measurement.
Example Usage
use ;
// Measure time complexity of a single-threaded synchronous process
.map
.unwrap_or_else;
// Measure memory complexity of an async process
# async ;
Getting Started
- Import the
TimeMeasurementorMemoryMeasurementstructs for access to measurement methods. - Use the traits
TimeComplexityandMemoryComplexityto implement custom measurement strategies if needed.