performance

Const, Move and RVO--Bartlomiej Filipek

const does not prevent (N)RVO, youhou.

Const, Move and RVO

by Bartlomiej Filipek

From the article:

C++ is a surprising language. Sometimes simple things are not that simple in practice. Last time I argued that in function bodies const should be used most of the time. But two cases were missed: when moving and when returning a value.

Does const influence move and RVO?

Order Your Members

How ordering members can impact performance.

Order Your Members

by Jonas Devlieghere

From the article:

The article highlights the impact that different choices regarding the ordering of members in a struct can have on the performance of your code. A lot can be achieved by taking into account some general guidelines.

Add a const here, delete a const there…--Bruce Dawson

Why constness is important in one article. Can be even better with constexpr.

Add a const here, delete a const there…

by Bruce Dawson

From the article:

I just completed a series of changes that shrunk the Chrome browser’s on-disk size on Windows by over a megabyte, moved about 500 KB of data from its read/write data segments to its read-only data segments, and reduced its private working set by about 200 KB per-process. The amusing thing about this series of changes is that they consisted entirely of removing const from some places, and adding const to others. Compilers be weird...

passing functions to functions--Vittorio Romeo

How do you pass functions?

passing functions to functions

by Vittorio Romeo

From the article:

Since the advent of C++11 writing more functional code has become easier. Functional programming patterns and ideas are powerful additions to the C++ developer's huge toolbox. (I recently attended a great introductory talk on them by Phil Nash at the first London C++ Meetup - you can find an older recording here on YouTube.)

In this blog post I'll briefly cover some techniques that can be used to pass functions to other functions and show their impact on the generated assembly at the end...