macos-perf

Crates.iomacos-perf
lib.rsmacos-perf
version0.1.1
sourcesrc
created_at2022-01-09 05:17:05.80473
updated_at2022-01-09 05:34:51.780621
descriptionMeasure the performance of Rust code on Apple's M1 series chips using performance counters.
homepage
repositoryhttps://github.com/siedentop/macos-perf
max_upload_size
id510668
size39,805
Christoph Siedentop (siedentop)

documentation

README

About

Measure the performance of Rust code on Apple's M1 series chips using performance counters. The resulting measurements will be much more stable than simply timing the execution. However, we still need to model the expected execution time based off the reported metrics.

Example

// See also examples/main.rs
use rust_macos_perf::{init, timeit_loops};

init().unwrap();
let pc = timeit_loops! {10, {
    // Your function here.
}}
.unwrap();
println!("{:?}", pc);

Warning

This is an extremely unstable API. Also the the underlying Apple functions may change anytime.

Requirements

  1. This only works on Apple M1 series chips.
  2. For this to work, the Apple Developer SDK needs to be installed. This can be installed via xcode-select --install. If anything else is missing, please file a ticket here on GitHub.
  3. The resulting program needs to be run with sudo.

Development

Please run tests both as sudo and without sudo.

Inspirations | Related Work

Commit count: 9

cargo fmt