performance

Do compilers take inline as a hint?--Simon Brand

Isn't that a good question?

Do compilers take inline as a hint?

by Simon Brand

From the article:

If you’ve spent any time in C or C++ communities online, you’ve probably seen someone say this:

inline used to be a hint for compilers to inline the definition, but no compilers actually take that into account any more.

You shouldn’t believe everything you see on the internet...

CppCon 2016: My Little Optimizer: Undefined Behavior is Magic--Michael Spencer

Have you registered for CppCon 2017 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2016 for you to enjoy. Here is today’s feature:

My Little Optimizer: Undefined Behavior is Magic

by Michael Spencer

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Compiler exploitation of undefined behavior has been a topic of recent discussion in the programming community. This talk will explore the magic of Undefined Behavior, Covering how and why modern optimizers exploit undefined behavior in C++ programs.

C++17 in detail: Parallel Algorithms -- Bartlomiej Filipek

Let’s see how C++17 can make writing parallel code a bit easier.

C++17 in details: Parallel Algorithms

by Bartlomiej Filipek

From the article:

With C++17 we get a lot of algorithms that can be executed in a parallel/vectorized way. That’s amazing, as it’s a solid abstraction layer. With this making, apps is much easier. A similar thing could be achieved possibly with C++11/14 or third-party APIs, but now it’s all in the standard.

CppCon 2016: Instruction Re-ordering Everywhere: The C++ 'As-If' Rule and the Role...--Charles Bay

Have you registered for CppCon 2017 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2016 for you to enjoy. Here is today’s feature:

Instruction Re-ordering Everywhere: The C++ 'As-If' Rule and the Role of Sequence

by Charles Bay

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

This is an introductory (i.e., "First Principles") dive into instruction re-ordering (at compile-time, and at run-time) due to conspiring by the compiler and CPU to make most efficient use of execution units and resources within the CPU processor core. Discussion is made of the role for sequence, for tracing of data flows and control flows, how "out-of-order" execution occurs within the compiler and CPU, and why that's a "good thing". The importance of the C++ "As-If" rule that allows these optimizations is explained.

Exploration is made of imperative versus sequential devices, physical versus logical sequences, and the role of the CPU cache line. At the end of this talk, it will be obvious for how and why instruction re-ordering occurs, and the programmer's need to consider logical dependencies (and not instruction order) when defining algorithms.

This talk is ideal for any programmer confused after observing instruction reordering in their running systems, and provides a solid basis to begin reasoning about how to leverage parallelism and be concerned with concurrency.