Skip to content
Proyek

fenbf/AwesomePerfCpp

Lihat di GitHub

Tentang

Daftar pilihan sumber daya pengoptimalan performa C/C++ yang keren: presentasi, artikel, buku, pustaka, alat, situs, dan blog. Terinspirasi oleh awesome.

Alat pengembangan

Cara angka ini diukur

2,571 bintang259 Fork +9 dalam 24 jam

Pertumbuhan bintang terukur

dalam 24 jam
+9
dalam 7 hari
+9
dalam 15 hari
+10
dalam 1 bulan
+10

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli

AwesomePerfCpp

Talks, articles, books, libraries, and tools for measuring and improving C and C++ performance.

Bartłomiej Filipek started this list in 2016 and still maintains it. He writes about modern C++ and software development on the C++ Stories blog and in its newsletter. GitHub profile · C++ Stories

Contents

Getting Started

  1. Measure your program before changing it. See the C++ Core Guidelines on performance.
  2. Watch Chandler Carruth show how the compiler and CPU affect small benchmarks in Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!.
  3. For an introduction to caches, watch Scott Meyers' CPU Caches and Why You Care. For more on how hardware affects algorithm design, read Algorithms for Modern Hardware.
  4. Find the slow part with a profiler. If you measure it separately, use the same kind of data the program normally handles. Save the inputs, build flags, and command so you can run the test again after a change. See Google Benchmark and How to microbenchmark.
  5. To practice finding bottlenecks, try the Performance Ninja exercises.

Talks

Talks are grouped by conference year. When applying techniques from older talks, check their assumptions about hardware and compiler behavior.

2026

2025

2024

2023

2022

2021

2020

2019

2018

2017

2016

2015

2014

2013

Articles

Dated articles are listed newest first within each topic, by publication, update, or edition year. Undated articles follow.

Measurement and profiling

CPU architecture, caches, and data layout

Modern C++ and allocation

Concurrency and low latency

Compilers and vectorization

GPU and heterogeneous computing

Sites/Blogs

Tools

Use a sampling profiler to identify CPU hotspots and an allocation tracer to find where memory is allocated. Check platform support, availability, and licensing in the tool's documentation.

CPU profiling and tracing

  • AMD uProf - CPU profiling and system analysis, including AMD hardware counters.
  • Compiler Explorer - Optimized assembly inspection and compiler comparison. Use workload profiling to measure runtime impact.
  • gperftools - CPU and heap profiling utilities, plus TCMalloc.
  • Intel VTune Profiler - CPU and GPU performance analysis. Hardware features vary by target.
  • Linux perf - Sampling, hardware counters, call graphs, and annotation on Linux.
  • TAU Performance System - Profiling and tracing parallel applications.
  • Tracy - Instrumentation and sampling, CPU/GPU timelines, allocations, and lock analysis.
  • uops.info - Measured x86 instruction latency, throughput, and port usage across microarchitectures.
  • Very Sleepy - A sampling CPU profiler for Windows.
  • Visual Studio CPU profiling - Native-code CPU usage analysis in Visual Studio.
  • Windows Performance Toolkit - Record and analyze ETW traces with Windows Performance Recorder and Analyzer.

Memory and allocation analysis

  • Deleaker - Commercial Windows allocation and resource-leak analysis.
  • heaptrack - Linux heap allocation tracing and analysis of allocation hotspots.
  • Valgrind - Instrumentation suite including Cachegrind, Callgrind, and Massif. Simulation and instrumentation can add substantial overhead.
  • WonderLeak - Windows heap and handle allocation profiling.

GPU and parallel analysis

Historical and specialized tools

Libraries

Benchmarking

If you're timing a function that processes a buffer, create the buffer before you start the timer. Check that the compiler hasn't optimized away the work you want to measure. Repeat the test, note whether the data is already in the cache, and compare the results with what you see in the application.

  • Google Benchmark - Microbenchmark framework with repetitions, fixtures, counters, and optimization barriers.
  • Celero - Benchmark authoring with baseline comparisons.
  • Hayai (archived introduction) - Historical C++ microbenchmarking framework.
  • Nonius - Historical benchmarking framework with statistical analysis. The source repository remains available.

Allocation, SIMD, and parallelism

  • fast_float - Numeric parsing with a from_chars-style interface and documented accuracy guarantees.
  • Highway - Portable SIMD intrinsics with multiple architectures and runtime target dispatch.
  • mimalloc - General-purpose allocator. Compare throughput and memory use in your application and check what it takes to adopt.
  • oneTBB - Task-based parallelism, concurrent containers, and scalable allocation facilities.
  • simdjson - SIMD JSON parser that selects an implementation at runtime. The project documents how it benchmarks parsing.
  • UltrafastSecp256k1 - High-performance secp256k1 engine with CPU, CUDA, OpenCL, embedded, and WebAssembly targets, plus broad benchmarking and validation tooling.

Books

  • Algorithms for Modern Hardware, Sergey Slotin - Free online book on CPU architecture, caches, SIMD, and algorithm engineering. Some planned chapters are incomplete.
  • Performance Analysis and Tuning on Modern CPUs, Denis Bakhvalov (second edition, 2024) - Free book and examples on hardware-aware measurement and tuning.
  • Optimizing software in C++, Agner Fog - Free optimization manual, maintained alongside the author's processor-specific references.
  • Optimizing C++, Wikibooks - Community reference. Some chapters are more complete or up to date than others.
  • Systems Performance: Enterprise and the Cloud, Brendan Gregg (second edition, 2020) - System-level methodology and Linux observability.
  • C++ Concurrency in Action, second edition, Anthony Williams - C++ concurrency and the memory model.
  • Optimized C++: Proven Techniques for Heightened Performance, Kurt Guntheroth - Practical C++ optimization and measurement.
  • Every Computer Performance Book, Bob Wescott - Performance analysis, capacity planning, and presenting results.
  • Power and Performance: Software Analysis and Optimization, Jim Kukunas - System-level analysis with a power/performance focus.
  • Video Game Optimization, Eric Preisz - Historical game-development optimization practices.
  • The Software Optimization Cookbook: High Performance Recipes for IA-32 Platforms, second edition - Older x86 reference. Check whether its advice applies to your CPU and compiler.
  • C++ Optimization Bibliography, Kurt Guntheroth (2016) - Further historical reading.

About

The collection was inspired by the awesome lists.

Submit additions and corrections through a pull request. For new resources, briefly explain what they cover and how they help readers working on C or C++ performance. Contribution guidelines

License

This work is licensed under a Creative Commons Attribution 4.0 International License.

Jelajahi proyek terkait

Memuat…