| Crates.io | optick-attr |
| lib.rs | optick-attr |
| version | 0.3.0 |
| created_at | 2020-08-04 00:36:35.586323+00 |
| updated_at | 2020-08-05 00:08:46.363155+00 |
| description | Super lightweight performance profiler: function attributes |
| homepage | |
| repository | https://github.com/bombomby/optick-attr-rs |
| max_upload_size | |
| id | 272709 |
| size | 6,696 |
A set of procedural macros to simplify performance instrumentation of the code.

In Cargo.toml add:
[dependencies]
optick = "1.3.2"
optick_attr = "0.3.0"
Instrument function. Example:
#[optick_attr::profile]
fn calc() {
// Do some stuff
}
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();
}
Use Optick GUI to open saved *.opt capture for further analysis: https://github.com/bombomby/optick/releases
Fully compatible with Rust Optick API.
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