Peach Profiler 🍑 is a performant, low-overhead profiler. It's just peachy.
Peach Profiler in action
use ;
// Add the `time_main` macro to the main function
// Time a function
---------- Outputs ----------
28657
______________________________________________________
Total time: 1.7490ms (CPU freq 4300860492)
answer_block[1]: 6665, (0.09%, 99.63% w/children)
fibonacci[57313]: 7487891, (99.54%)
To Use
The Peach Profiler will only add the instrumentation needed to profile and
output performance metrics if the profile feature is enabled. Without it just
the Total time will be shown if main is marked with #[time_main].
Either add the profile feature with the dependancy in the Cargo.toml file, i.e.:
[]
= { = "0.2", = ["profile"]}
to always profile your code.
Or add a feature to your crate in the Cargo.toml file, i.e.:
[]
= ["peach_profiler/profile"]
And then instrumentation will only be added when your program is run with the
feature specified, i.e. cargo r --features=profile
Run in a no_std env by disabling default features:
[]
= { = "0.2", = false }