flâneur — a map of the web's best reading

Three Optimization Tips for C++ - Engineering at Meta

engineering.fb.com · 2,006 words · saved by 1 readers

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&#8217

Explore this link on the map →

related reading