# What is perf.rust-lang.org measuring and why is "instructions:u" the default?

**URL:** <https://internals.rust-lang.org/t/what-is-perf-rust-lang-org-measuring-and-why-is-instructions-u-the-default/9815>\
**Category:** compiler\
**Created:** [April 14, 2019, 1:47pm UTC](https://internals.rust-lang.org/t/what-is-perf-rust-lang-org-measuring-and-why-is-instructions-u-the-default/9815 "2019-04-14T13:47:49Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![petrochenkov](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/petrochenkov/32/2784_2.png) [@petrochenkov](https://internals.rust-lang.org/u/petrochenkov)\
**Post date:** [April 14, 2019, 3:25pm UTC](https://internals.rust-lang.org/t/what-is-perf-rust-lang-org-measuring-and-why-is-instructions-u-the-default/9815/4 "2019-04-14T15:25:54Z")

</div>

> [@eddyb](#):
>
> Also, counting the number of events (rather than wall-time/clock cycles) helps normalize variance due to the OS and other processes coexisting on the same CPU and memory hierarchy

I wonder if PMUs provide some counters that are stable like "number of retired instructions" (not affected by other processes touching caches), but more precise, like "number of retired `(uop * static_weight_in_cycles(uop))`s". Need to check.

Update: There's only unweighted `UOPS_RETIRED.ALL` (and a bunch of finer-grained counters for specific kinds of instructions).

(Still feels wrong to measure that though, would be preferable to use cycles and try eliminating "other processes" on the perf machine instead.)

---

_[View the full topic](https://internals.rust-lang.org/t/what-is-perf-rust-lang-org-measuring-and-why-is-instructions-u-the-default/9815)._
