Performance Hints
Over the years, we (Jeff & Sanjay) have done a fair bit of diving into performance tuning of various pieces of code, and improving the performance of our software has been important from the very earliest days of Google, since it lets us do more for more users. We wrote this document as a way of identifying some general principles and specific techniques that we use when doing this sort of work, and tried to pick illustrative source code changes (change lists, or CLs) that provide examples of the various approaches and techniques. Most of the concrete suggestions below reference C++ types and CLs, but the general principles apply to other languages. The document focuses on general performance tuning in the context of a single binary, and does not cover distributed systems or machine learning (ML) hardware performance tuning (huge areas unto themselves). We hope others will find this useful. Many of the examples in the document have code fragments that demonstrate the techniques (click
abseil / Performance Hints Performance Hints Jeff Dean , Sanjay Ghemawat Original version: 2023/07/27, last updated: 2025/12/16 Expand all details Collapse all details Over the years, we (Jeff & Sanjay) have done a fair bit of diving into performance tuning of various pieces of code, and improving the performance of our software has been important from the very earliest days of Google, since it lets us do more for more users. We wrote this document as a way of identifying some general principles and specific techniques that we use when doing this sort of work, and tried to pick illustrative so
saved by
- Karan MJ
- Zhi Ying Sun
- Benedict Neo
- Aaron Pham
- Dhruv Sheth
- Julian H
- Jon
- Rohan Kanti
- Ishan Mukherjee
- Will Anderson
- Davis Brown
- Devin Plumb
related reading
- abseil / Performance Hintsabseil.io
- How to Optimize a CUDA Matmul Kernel for cuBLAS-like Performance: a Worklogsiboehm.com
- Making Deep Learning go Brrrr From First Principleshorace.io
- ⭐️ Fast LLM Inference From Scratchandrewkchan.dev
- There's no reason for software to be slow anymoredanluu.com
- Essays on programming I think about a lot | benkuhn.netbenkuhn.net
- Speeding Up the Webcola Graph Viz Library with Rust + WebAssembly - Casey Primozic's Homepagecprimozic.net
- Infographics: Operation Costs in CPU Clock Cycles - 6IT6it.dev
- Effortless Performance Improvements in C++ | Julien Jorge's Personal Websitejulien.jorge.st
- Transformers Inference Optimization Toolset | AstraBlogastralord.github.io
- GitHub - google-research/tuning_playbook: A playbook for systematically maximizing the performance of deep learning models.github.com
- sled theoretical performance guide | sled-rs.github.iosled.rs