Kolbold - Performance Measurement Library
Kolbold is a comprehensive Rust library designed to measure the time and memory complexity of code execution, offering tools for tracking CPU and memory usage in both single-threaded and multi-threaded contexts. It supports synchronous and asynchronous code execution, making it versatile for various performance analysis needs.
This library is particularly suited for developers who need to profile and benchmark Rust applications, with detailed metrics available for time and memory usage across different runtime contexts.
Core Modules
kolbold_core: Contains the core functionality for time and memory measurements, including theTimeComplexityandMemoryComplexitytraits, and structs for capturing these metrics (TimeMeasurement,MemoryMeasurement).kolbold_macros: Provides procedural macros used in simplifying metric implementations.
Primary Features
- Time Complexity Measurement: Track CPU usage and execution time in both synchronous and asynchronous contexts.
- Memory Complexity Measurement: Capture memory usage during function execution, with support for synchronous and asynchronous measurement.
- Thread-Specific Metrics: Detailed metrics for individual threads in multi-threaded environments, aiding in granular performance analysis.
- Re-Exports for Convenience: Common traits and structs, such as
TimeComplexity,MemoryComplexity,TimeMeasurement, andMemoryMeasurement, are re-exported for ease of use.
Example Usage
use ;
use Result;
// Measure time complexity of a single-threaded synchronous function
async
Getting Started
- Add
kolboldas a dependency in yourCargo.toml:
[]
= "1.1.0"
-
Import the measurement structs (
TimeMeasurement,MemoryMeasurement) for access to time and memory measurement methods. -
If needed, extend functionality by implementing
TimeComplexityandMemoryComplexitytraits in your custom types.
More Information
For details on each component, refer to the documentation for:
kolbold_core: Core measurement functionalitieskolbold_macros: Macros that simplify trait implementations