Skip to content

ryansname/iaca-markers-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unsupported

I consent to the transfer of this crate to the first person who asks help@crates.io for it.

iaca-markers-rs

Adds IACA compatible macros for rust to identify and fix bottlenecks and improve throughput.

Usage

When compiling with IACA enabled your executable will not run.

  1. Instead add the macros around the section you wish to profile as below.
  2. Compile in release mode: cargo build --release.
  3. Run IACA from the link above (eg.): ./iaca.sh -64 ~/path/to/exe/release/librustlib.rlib
  4. Enjoy the extremely detailed output.
#![feature(asm)]

#[macro_use] extern crate iaca_markers;

fn main() {
    let mut a = 0;
    for i in 0..100 {
        iaca_start!();

        // Do some work
        a += i;
    }
    iaca_end!();

    println!("Summed to {}", a);
}

Notes

I have run this successfully with rustc 1.2.0-nightly (e4c64a149 2015-05-27). It may require beta or nightly rust for the moment until the asm feature is stabilized.

About

Adds IACA compatible macros for rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages