by Charlie Curtsinger and Emery Berger
Coz is a profiler for native code (C/C++/Rust) that unlocks optimization opportunities missed by traditional profilers. Coz employs a novel technique called causal profiling that measures optimization potential. It predicts what the impact of optimizing code will have on overall throughput or latency.
Profiles generated by Coz show the "bang for buck" of optimizing a line of code in an application. In the below profile, almost every effort to optimize the performance of this line of code directly leads to an increase in overall performance, making it an excellent candidate for optimization efforts.
Coz's measurement matches developers' assumptions about profilers: that optimizing highly-ranked code will have the greatest impact on performance. Causal profiling measures optimization potential for serial, parallel, and asynchronous programs without instrumentation of special handling for library calls and concurrency primitives. Instead, a causal profiler uses performance experiments to predict the effect of optimizations. This allows the profiler to establish causality: "optimizing function X will have effect Y," exactly the measurement developers had assumed they were getting all along.
Full details of Coz are available in our paper, Coz: Finding Code that Counts with Causal Profiling (pdf), SOSP 2015, October 2015 (recipient of a Best Paper Award).
Download the latest release for your platform from the GitHub Releases page.
Debian/Ubuntu (.deb):
# Download the .deb for your architecture (amd64 or arm64)
sudo dpkg -i coz_VERSION_amd64.debFedora/RHEL/CentOS (.rpm):
# Download the .rpm for your architecture (x86_64 or aarch64)
sudo rpm -i coz-VERSION-1.x86_64.rpmGeneric Linux (tarball):
tar xzf coz-VERSION-linux-x86_64.tar.gz
cd coz-VERSION-linux-x86_64
sudo ./install.sh # Installs to /usr/local by default
sudo ldconfig