Coz is a profiler for native code that uses causal profiling to measure optimization potential.
Traditional profilers identify hot code paths but cannot predict whether optimizing them will improve overall performance. Coz solves this by running performance experiments that establish causality between code optimizations and their effects on throughput or latency. Rather than instrumenting code or adding special handling for concurrency, the tool uses sampling to predict what impact optimizing a specific line will have on the entire application. This approach works across serial, parallel, and asynchronous programs without requiring library-specific knowledge.
Coz suits developers working on C, C++, or Rust applications where performance matters and traditional profiling has left optimization opportunities unclear. The tool runs on Linux systems with kernel version 2.6.32 or later and on macOS, though the macOS implementation relies on Apple's private kperf framework and may require elevated privileges or System Integrity Protection adjustments. Community ports exist for Java, Go, and Swift. Choose this tool when you need to know not just where time is spent, but where optimization effort will yield the greatest return.
The project maintains pre-built packages for Debian, Ubuntu, Fedora, RHEL, CentOS, and generic Linux distributions. Building from source requires standard development tools and automatically fetches additional dependencies during configuration. The benchmark suite is available as an optional build target for those wanting to evaluate the tool's effectiveness on representative workloads.