CppCon 2016: Want fast C++? Know your hardware!--Timur Doumler

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:

Want fast C++? Know your hardware!

by Timur Doumler

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

As C++ evolves, it provides us with better and more powerful tools for optimal performance. But often, knowing the language very well is not enough. It is just as important to know your hardware. Modern computer architectures have many properties that can impact the performance of C++ code, such as cache locality, cache associativity, true and false sharing between cores, memory alignment, the branch predictor, the instruction pipeline, denormals, and SIMD. In this talk, I will give an overview over these properties, using C++ code. I will present a series of code examples, highlighting different effects, and benchmark their performance on different machines with different compilers, sometimes with surprising results. The talk will draw a picture of what every C++ developer needs to know about hardware architecture, provide guidelines on how to write modern C++ code that is cache-friendly, pipeline-friendly, and well-vectorisable, and highlight what to look for when profiling it.

ACCU 2017 Videos Online

The recordings of the recent ACCU conference in Bristol are now online.

ACCU 2017 Conference Channel

by the ACCU conference

About the conference:

All the speaker made the this years conference to one of the most successful ones. Below are the speakers listed with C++ sessions.

Day One with Louis Dionne, Anastasia Kazakova, Roger Orr, Marshall Clow, Frank Birbacher, Timur Doumler, Kevlin Henney

Day Two with Hubert Matthews, Arne Metz, Guy Davidson, Peter Sommerlad, John Lakos

Day Three with Atho Truu, Daniel Garcia, Petr Kudriavtsev, Steven Simpson, Sergei Sadovnikov, Dominic Robinson, Bjorn Fahller

Day Four with Vittorio Romeo, Phil Nash, Niall Douglas, Anthony Williams, Odin Holmes

Herb Sutter's closing keynote about C++ meta classes will be released later.

 

 

 

Using C++ Coroutines with Boost C++ Libraries--Eric Battalio

Working with the future tools.

Using C++ Coroutines with Boost C++ Libraries

by Eric Battalio

From the article:

Last month, Jim Springfield wrote a great article on using C++ Coroutines with Libuv (a multi-platform C library for asynchronous I/O). This month we will look at how to use coroutines with components of Boost C++ libraries, namely boost::future and boost::asio...

CppCon 2016: Using Types Effectively--Ben Deane

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:

Using Types Effectively

by Ben Deane

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

C++ has a pretty good type system, and modern C++ gives us a greater ability than ever before to use that type system for good: to make APIs easier to use and harder to misuse, to make our datatypes more closely express our intent, and generally to make code safer, more obvious in function and perhaps even faster.

This is an interactive session - incorporating games played between presenter and audience, even - taking a look at choices available to us as datatype and API designers, and examining how a little knowledge about the algebra of algebraic datatypes can help. We'll see why std::optional and (hopefully soon) std::variant will quickly become an essential part of everyone's toolbox, and also explore how types can be used to express not just the structure of data, but also the behaviour of objects and functions.

doctest - C++ single-header testing framework version 1.2 released! -- Viktor Kirilov

The fastest feature-rich C++98/C++11 single-header testing framework for unit tests and TDD

doctest 1.2 released! Focus on features and runtime performance

by Viktor Kirilov

From the release:

The reddit thread might be of interest as well.

CppCon 2016: The strange details of std::string at Facebook--Nicholas Ormrod

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:

The strange details of std::string at Facebook

by Nicholas Ormrod

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Standard strings are slowing you down. Strings are everywhere. Changing the performance of std::string has a measurable impact on the speed of real-world C++ programs. But how can you make strings better? In this talk, we'll explore how Facebook optimizes strings, especially with our open-source std::string replacement, fbstring. We'll dive into implementation tradeoffs, especially the storage of data in the struct; examine which standard rules can and cannot be flouted, such as copy-on-write semantics; and share some of the things we've learned along the way, like how hard it is to abolish the null-terminator. War stories will be provided.

Quick Q: Is list::size() really O(n)?

Quick A: In C++11 it's required to be constant time.

Recently on SO:

Is list::size() really O(n)?

In C++11 it is required that for any standard container the .size() operation must be complete in "constant" complexity (O(1)). (Table 96 — Container requirements). Previously in C++03 .size() should have constant complexity, but is not required (see Is std::string size() a O(1) operation?).

The change in standard is introduced by n2923: Specifying the complexity of size() (Revision 1).

CppCast Episode 101: Build 2017 with Kenny Kerr and Marian Luparu

Episode 101 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob travels to the Microsoft Build Developer's Conference to interview Kenny Kerr from the Windows team and Marian Luparu from the Visual Studio C++ team.

CppCast Episode 101: Build 2017 with Kenny Kerr and Marian Luparu

by Rob Irving and Jason Turner

About the interviewees:

Kenny Kerr is an engineer on the Windows team at Microsoft, an MSDN Magazine contributing editor, Pluralsight author, and creator of moderncpp.com (C++/WinRT). He writes at kennykerr.ca and you can find him on Twitter at @kennykerr.

Marian Luparu is currently leading the team responsible for making Visual Studio more productive for C++ developers.