Three Optimization Tips for C++ - Engineering at Meta
This is an approximate transcript of my talk at Facebook NYC on December 4, 2012, which discusses optimization tips for C++ programs. The video of the talk is here and the accompanying slides are here. Commonly given advice about approaching optimization in general, and optimization of C++ code in particular, includes: That’s great advice, save for two issues. First, it has becomed hackneyed by overuse and is often wielded to dogmatically smother new discussions before they even happen. Second, some of it is vague. For example, “choose the right algorithm” is vacuous without a good understanding of what algorithms are best supported by the computing fabric, which is complex enough to make certain algorithmic approaches better than others overall. So I won’t focus on the above at all; I assume familiarity with such matters and a general “Ok, now what to do?” attitude. With that in mind, I’ll discuss simple high-level pieces of advice that are likely to lead to better code on modern comp
By Andrei Alexandrescu This is an approximate transcript of my talk at Facebook NYC on December 4, 2012, which discusses optimization tips for C++ programs. The video of the talk is here and the accompanying slides are here . Scope Commonly given advice about approaching optimization in general, and optimization of C++ code in particular, includes: Quoting Knuth more or less out of context The classic one-two punch: (a) Don’t do it; (b) Don’t do it yet Focus on algorithms, not on micro-optimization Most programs are I/O bound Avoid constructing objects unnecessarily Use C++11’
Explore this link on the map →related reading
- abseil / Performance Hintsabseil.io
- Optimization of Computer Programs in Cicps.u-strasbg.fr
- Algorithms for Modern Hardware - Algorithmicaen.algorithmica.org
- abseil / Performance Hintsabseil.io
- Rust Optimization.md · GitHubgist.github.com
- Effortless Performance Improvements in C++ | Julien Jorge's Personal Websitejulien.jorge.st
- Paul Buchheit: Optimizing everything: some details matter a lot, most don'tpaulbuchheit.blogspot.com
- how I think when I think about programming - alice mazalicemaz.com
- Infographics: Operation Costs in CPU Clock Cycles - 6IT6it.dev
- Competitive Programmer's Handbookcses.fi
- The compiler will optimize that away | RoyalSlothblog.royalsloth.eu
- Compilers - What Every Programmer Should Know About Compiler Optimizations | Microsoft Learnlearn.microsoft.com