An intrusive flamegraph profiling library for Rust that lets developers instrument specific code sections for performance analysis.
FLAME is a flamegraph profiling library for Rust that enables developers to instrument specific sections of their code to measure execution time. It solves the problem of identifying performance bottlenecks by providing hierarchical timing data that can be visualized as interactive flamegraphs. Unlike system-level profilers, it gives developers control over what gets measured.
Rust developers who need to profile and optimize performance-critical sections of their applications, particularly those working on systems where fine-grained timing control is important.
Developers choose FLAME because it offers intrusive, targeted profiling instead of system-wide sampling, allowing them to focus instrumentation exactly where needed. Its simple API and ability to generate visual flamegraphs directly make performance analysis more accessible.
An intrusive flamegraph profiling tool for rust.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers multiple methods like start/end pairs, span_of for closures, and guard-based timing with start_guard, allowing developers to choose the most convenient way to instrument code, as shown in the README examples.
Includes dump_html to generate visual, hierarchical flamegraphs directly from collected data, making it easy to identify bottlenecks at a glance, with examples provided in the README.
Provides spans() function to access profiling data for custom analysis, enabling integration with other tools or bespoke processing, as mentioned in the key features.
Allows adding notes at specific instants to mark events, aiding in correlating timing data with program logic, demonstrated in the code snippet with flame::note.
Requires manual code changes to add profiling points, which can be time-consuming and may not cover all execution paths without careful planning, as highlighted by its philosophy of selective instrumentation.
Focuses solely on execution time and does not measure other performance aspects like memory usage or I/O, which might be needed for comprehensive profiling, unlike broader system profilers.
The added instrumentation introduces runtime overhead that could affect performance measurements, especially in tight loops, though this is a trade-off for precise control.