optick-attr

Crates.iooptick-attr
lib.rsoptick-attr
version0.3.0
sourcesrc
created_at2020-08-04 00:36:35.586323
updated_at2020-08-05 00:08:46.363155
descriptionSuper lightweight performance profiler: function attributes
homepage
repositoryhttps://github.com/bombomby/optick-attr-rs
max_upload_size
id272709
size6,696
Vadim Slyusarev (bombomby)

documentation

README

Function attributes for Optick Profiler

Build Status Crates.io Docs

A set of procedural macros to simplify performance instrumentation of the code.

How to use

In Cargo.toml add:

[dependencies]
optick = "1.3.2"
optick_attr = "0.3.0"

[optick_attr::profile]

Instrument function. Example:

#[optick_attr::profile]
fn calc() {
    // Do some stuff
}

[optick_attr::capture("capture_name")]

Generate performance capture for function. Capture is saved to {working_dir}/capture_name(date-time).opt. Example:

#[optick_attr::capture("capture_name")]
pub fn main() {
    calc();
}

GUI

Use Optick GUI to open saved *.opt capture for further analysis: https://github.com/bombomby/optick/releases

Optick API

Fully compatible with Rust Optick API.

Run as Administartor to collect ETW events

Optick uses ETW to collect hardware counters: switch-contexts, auto-sampling, CPU core utilization, etc. Run your app as administrator to enable the collection of ETW events:

Start-Process cargo run -Verb runAs
Commit count: 12

cargo fmt