Simple Runtime Analyzer
|
A C++ Header-Only Runtime Performance Analysis Library
Simple Runtime Analyzer is a header-only C++ library for precise runtime performance profiling and benchmarking. It provides a modern, type-safe API to measure and analyze the execution time of functions and algorithms across varying input sizes.
Engineered with C++23 features, Simple Runtime Analyzer offers a streamlined workflow: from generating customizable sample data and collecting high-resolution timing metrics, to exporting detailed reports in multiple formats (TXT, CSV, JSON). Its modular design decouples measurement from reporting, making it an ideal tool for embedding performance analysis directly into unit tests, CI pipelines, or research projects.
The Simple Runtime Analyzer was born from a desire to create a reproducible and modular tool for measuring execution time using std::chrono. Beyond its benchmarking capabilities, the library is designed as an educational tool to demonstrate algorithmic complexity and real-world runtime behavior across varying input sizes.
This library provides a set of powerful utilities to streamline your performance analysis.
The example.cpp
file provides a complete, working example of how to use the Simple Runtime Analyzer library. This file demonstrates a full performance analysis workflow, from generating test data and profiling an algorithm to reporting the results and generating a visual plot. You can find this example at the following path:
example/src/example.cpp
matplotlib
library (for visualization)Since the Simple Runtime Analyzer is a header-only library, it's very easy to use and requires no pre-compilation or installation. You can get the latest version of the headers here: releases.
To use the library's components in your code, simply include the necessary header files. All functions and structures are located within the sra
namespace.
Once you've generated reports using the C++ library, you can visualize them with the plot.py
script from the command line. Simply pass the report files as arguments.
For a comprehensive overview of the library, including a detailed API reference for each module, please visit the official documentation website.
https://shineknightdev.github.io/simple-runtime-analyzer
If you like the project and it seems useful, consider give a star ⭐️ to the repository to show your support and Follow me on Github To be aware of my new projects. I appreciate all kinds of contributions. Whether you are reporting an error, suggesting a new feature or sending a change of code, your help is valuable.
⚖️ Code of Conduct A set of rules to ensure the community remains a welcoming and inclusive place.
👷🏻♂️ Contributing Guide Details on how to get started, including how to report bugs, suggest features, and submit your first pull request.
💸 Sponsor If you find this Toolkit useful, you can support me by sponsoring new projects.
📜 This project is licensed under the MIT License © 2025 Diego Osorio (ShineKnightDev).