plasma-umass/coz
FreeCoz: Causal Profiling
FreeFree tier
About plasma-umass/coz
Coz is a profiler for native code (C/C++/Rust) that employs causal profiling to measure optimization potential. It predicts the impact of optimizing code on overall throughput or latency, enabling developers to focus on optimizations that truly matter. Unlike traditional profilers, Coz establishes causality: 'optimizing function X will have effect Y'. It works for serial, parallel, and asynchronous programs without requiring special instrumentation or handling of library calls and concurrency primitives. Coz was developed at the University of Massachusetts Amherst (PLASMA lab) and won a Best Paper Award at SOSP 2015.
Key Features
Causal profiling measures optimization potential, not just hotspots
Predicts the performance impact (throughput/latency) of optimizing specific lines of code
Works with C, C++, and Rust programs natively
Supports serial, parallel, and asynchronous programs without special instrumentation
Cross-platform: Linux (perf_event_open) and macOS (kperf)
Language wrappers available for Java, Go, and others
Open source with pre-built packages (deb, rpm, tarball) for easy installation
Pros & Cons
Pros
- Novel causal profiling approach that directly measures the actual impact of optimizations
- Helps developers prioritize optimization efforts on code that truly matters
- Open source and free to use (MIT license)
- Supports multiple languages and platforms (Linux, macOS)
- No special instrumentation or source code modifications required
Cons
- Limited to Linux and macOS; no Windows support
- macOS usage requires elevated privileges or System Integrity Protection adjustments
- Steep learning curve for the causal profiling concept compared to traditional profilers
- May not work with all code patterns or deeply nested concurrency
- Only supports native code; no direct support for interpreted languages (though wrappers exist for some)
Best For
Performance optimization of native applications (C/C++/Rust)Identifying code with the highest optimization potential ('bang for buck')Analyzing bottlenecks in concurrent and parallel programsResearch in performance engineering and causal profiling techniquesGuiding optimization efforts in latency-sensitive systems
FAQ
What is causal profiling?
Causal profiling is a technique that measures optimization potential by running performance experiments. It predicts the effect of optimizations, establishing causality: 'optimizing function X will have effect Y'. This gives developers accurate guidance on which code to optimize.
What platforms does Coz support?
Coz works on Linux systems (kernel 2.6.32 or later with perf_event_open) and macOS (using Apple's kperf framework). Both require a Python 3.x interpreter.
Does Coz require special instrumentation of the program?
No. Coz uses performance experiments and does not require instrumentation or special handling for library calls and concurrency primitives.
What languages are supported by Coz?
By default, Coz works for C, C++, and Rust. It also has ports/wrappers for Java (JCoz), Go (Cozgo), and others.
Is Coz free and open source?
Yes, Coz is open source and free to use. It is available on GitHub under an MIT license.