Compaile / ctrack

A lightweight, high-performance C++ benchmarking and tracking library for effortless function profiling in both development and production environments. Features single-header integration, minimal overhead, multi-threaded support, customizable output, and advanced metrics for quick bottleneck detection in complex codebases.
MIT License
132 stars 5 forks source link

Per thread view #8

Open zzarm opened 2 months ago

zzarm commented 2 months ago

it would be cool to be able to support a per-thread timeline view (e.g. time intervals annotated by the functions being called by each thread)

Compaile commented 2 months ago

Can you explain more about your idea? Do you think about a sort of flame-graph ?

zzarm commented 2 months ago

Yes, I was thinking of something exactly like a flame graph, with time on the horizontal axis and activities from each thread stacked vertically, each occupying individual lines and extending along the time axis. Different activities from each thread can be represented as intervals with start and end timestamps as well as the the name of function being tracked. Currently, the stats show the total time of the tracked functions run by all the threads. Even though the overlapping time is excluded, if the threads do not start calling the function at the same time, I feel that the resulting times for the functions are not easy to analyze.