Alexandrescu Video – Three Optimization Tips for C++

Andrei Alexandrescu gave this talk on optimization tips for C++. He claims you should aim to:

  • Measure performance against a baseline
  • Choose algorithms that use the least heavyweight operations
  • Reduce array writes

The slides are also available.

Measuring gives you a leg up on experts who don’t need to measure

He also presents a handy ordering of different integral/floating point operations in terms of cost. The techniques (which he has internalised to give a gut feel of whether some improvement will produce a speed-up) are illustrated with a classic interview question (convert an integer to ascii) that is heavily used at Facebook.

The underlying message of this presentation is that the cost of one engineer spending time producing some pretty esoteric code with massive performance benefits is more than outweighed by the savings in terms of data centre costs (due to improved speed, you can scale back spend on servers).

Leave a comment

Filed under C++, Video

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.