autofdo  by google

AutoFDO builds tools using clang

Created 11 years ago
564 stars

Top 57.0% on SourcePulse

GitHubView on GitHub
Project Summary

AutoFDO is a toolchain extension that automatically optimizes C/C++ programs by leveraging hardware performance counters and profile-guided optimization (PGO). It targets developers and researchers seeking to improve application performance without manual code changes, by generating optimized binaries based on runtime profiling data.

How It Works

AutoFDO instruments binaries to collect hardware performance counter data (like cache misses, branch mispredictions) during execution. This data is then used to generate a profile that guides the compiler (Clang/GCC) to make optimization decisions, such as function layout and inlining, to improve instruction cache locality and reduce branch mispredictions.

Quick Start & Requirements

  • Install: sudo apt install libunwind-dev libgflags-dev libssl-dev libelf-dev protobuf-compiler cmake zstd clang g++
  • Build: Clone repo, checkout tag v0.20.1, mkdir build && cd build, cmake -DCMAKE_C_COMPILER=clang-10 -DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_BUILD_TYPE=Release ../, make -j 4.
  • Prerequisites: Ubuntu 20.04, clang-10 (or g++-9), cmake, zstd, protobuf-compiler, libunwind-dev, libgflags-dev, libssl-dev, libelf-dev.

Highlighted Details

  • Leverages hardware performance counters for profile generation.
  • Supports profile-guided optimization (PGO) for Clang and GCC.
  • Focuses on function layout and inlining for performance gains.

Maintenance & Community

  • Developed by Google.
  • No explicit community links (Discord, Slack) or roadmap provided in the README.

Licensing & Compatibility

  • License: Apache License 2.0.
  • Compatible with commercial use and closed-source linking.

Limitations & Caveats

The build process requires specific compiler versions (clang-10 or g++-9) and is demonstrated on Ubuntu 20.04, suggesting potential compatibility issues on other distributions or newer Ubuntu versions.

Health Check
Last Commit

1 month ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
1 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.