Minimal Rust wrapper around the Remotery
real-time CPU profiler.
GPU profiling is not supported.
Inspired by (seemingly outdated and abandoned) remotery
,
which this is a slightly updated version of.
- Call
Remotery::initialize
at application startup.
use miniremotery::Remotery;
use strum::EnumMessage;
let profiler = Remotery::initialize().unwrap_or_else(
|error| panic!(
"Remotery initialization error: {}"
,error.get_detailed_message().unwrap()
)
);
// Remotery is finalized when `profiler` goes out of scope.
- Add calls to
Remotery::scope
to code scopes you want to profile.
use miniremotery::{ Remotery, rmtSampleFlags };
fn does_something_complicated() {
let _scope = Remotery::scope("does_something_complicated", rmtSampleFlags::RMTSF_None);
// Some expensive calculations.
// Remotery gathers timing data when `_scope` goes out of scope.
}
- Open
vis/index.html
when the profiled application is running to view real-time profile data.
Refer to Remotery
repo for more info.