Skip to content

Latest commit

 

History

History
102 lines (78 loc) · 4.06 KB

File metadata and controls

102 lines (78 loc) · 4.06 KB

C++ High Performance Guide

Stars CI License

English | 简体中文 | GitHub Pages | Discussions

Learn measurable C++20 performance engineering through runnable examples, benchmarks, and a VitePress-powered learning site.

Why this repository exists

This project is a practical guide to common C++ performance topics that are easy to talk about but harder to validate:

  • modern CMake and preset-driven builds
  • memory and cache layout decisions
  • modern C++ performance patterns
  • SIMD and vectorization
  • concurrency and lock-free basics
  • profiling and benchmark-driven reasoning

Every major topic is meant to be readable, buildable, and measurable.

What you can explore

Area What it covers
examples/01-cmake-modern/ modern CMake structure and anti-patterns
examples/02-memory-cache/ AOS vs SOA, false sharing, alignment, prefetch
examples/03-modern-cpp/ constexpr, move semantics, reserve, ranges
examples/04-simd-vectorization/ auto-vectorization, intrinsics, SIMD wrappers
examples/05-concurrency/ atomics, lock-free queue, OpenMP
docs/ bilingual Pages whitepaper covering academy, architecture, playbook, reference, research

Quick start

git clone https://github.com/LessUp/cpp-high-performance-guide.git
cd cpp-high-performance-guide

cmake --preset=release
cmake --build build/release

Run one benchmark:

./build/release/examples/02-memory-cache/aos_soa_bench

Need the redesigned docs route after the quick start? Start with docs/en/playbook/index.md, then continue to docs/en/guides/validation.md for sanitizer-specific guidance.

Validation commands

cmake --preset=debug && cmake --build build/debug && ctest --preset=debug
cmake --preset=release && cmake --build build/release && ctest --preset=release

cmake --preset=asan && cmake --build build/asan && ctest --preset=asan
cmake --preset=tsan && cmake --build build/tsan && ctest --preset=tsan
cmake --preset=ubsan && cmake --build build/ubsan && ctest --preset=ubsan

Documentation entry points

Tech stack

  • Language: C++20
  • Build: CMake 3.22+, Ninja
  • Testing: Google Test, RapidCheck
  • Benchmarking: Google Benchmark
  • Docs: VitePress + GitHub Pages
  • Profiling: perf, FlameGraph, Valgrind, VTune

Contributing

See CONTRIBUTING.md for the contributor workflow, hooks setup, and OpenSpec process.