Video & On-Demand

CppCon 2019: Floating-Point <charconv>: Making Your Code 10x Faster With C++17's Final Boss--STL

This year, CppCon 2020 is going virtual. The dates are still the same – September 14-18 – and we are aiming for the CppCon live event to have pretty much everything you’re familiar with at CppCon except moved online: multiple tracks including “back to basics” and a new “embedded” track; live speaker Q&A; live talk time zones friendly to Americas and EMEA (and we’re going to try to arrange around-the-clock recorded repeats in all time zones, where speakers who are available can be available for live Q&A in their repeated talks too, and we’ll do that if it’s possible – but we’re still working on it!); virtual tables where you can interact face-to-face online with other attendees just like at the physical event; virtual exhibitor spaces where you can meet the folks on your favorite product’s teams to ask them question face-to-face; pre- and post-conference classes; and even the CppCon house band playing live before every plenary session. All talk recordings will be freely available as usual on YouTube a month or two after the event, but everything else above will be available only live during CppCon week.

To whet your appetite for this year’s conference, here’s another of the top-rated talks from last year. Enjoy – and register today for CppCon 2020 – all the spirit and flavor of CppCon, this year all virtual and online!

Floating-Point <charconv>: Making Your Code 10x Faster With C++17's Final Boss

by Stephan T. Lavavej

Summary of the talk:

Floating-point numbers are ancient, mysterious, and terrifying. Over the past 30 years, the C and C++ Standards have provided many functions for floating-point/string conversions, such as C's strtof(), strtod(), and printf() %a %e %f %g, and C++'s iostreams, stof(), stod(), and to_string(). Despite this history, floating-point is far from a solved problem - these functions have ranged from annoyingly to egregiously slow, and application developers and library maintainers alike have found it exceedingly difficult to understand floating-point behavior.

This session will present new and wondrous developments in the area of floating-point conversions. If your serialization code is bottlenecked by floating-point printing, this will accelerate your code by roughly 3x to 30x (yes, times, not percent). You can also improve the human-readability of your output. Along the way, this session will cover the basics of floating-point representations, dispelling common myths like fuzziness and non-determinism.

Specifically, C++17 added 3 pages of Standardese describing the charconv header and its functions from_chars() and to_chars(). This feature has required an unexpectedly large amount of implementation work, taking over a dev-year for MSVC and becoming the last C++17 library feature to ship. Coincidentally, Ulf Adams at Google developed a novel algorithm named Ryu, which is responsible for the amazing speed of to_chars(). This session will focus on how to use charconv and how to understand its many supported formats, with a brief overview of Ryu's techniques.

CppCon 2019: Mesh: Automatically Compacting Your C++ Application's Memory--Emery Berger

This year, CppCon 2020 is going virtual. The dates are still the same – September 14-18 – and we are aiming for the CppCon live event to have pretty much everything you’re familiar with at CppCon except moved online: multiple tracks including “back to basics” and a new “embedded” track; live speaker Q&A; live talk time zones friendly to Americas and EMEA (and we’re going to try to arrange around-the-clock recorded repeats in all time zones, where speakers who are available can be available for live Q&A in their repeated talks too, and we’ll do that if it’s possible – but we’re still working on it!); virtual tables where you can interact face-to-face online with other attendees just like at the physical event; virtual exhibitor spaces where you can meet the folks on your favorite product’s teams to ask them question face-to-face; pre- and post-conference classes; and even the CppCon house band playing live before every plenary session. All talk recordings will be freely available as usual on YouTube a month or two after the event, but everything else above will be available only live during CppCon week.

To whet your appetite for this year’s conference, here’s another of the top-rated talks from last year. Enjoy – and register today for CppCon 2020 – all the spirit and flavor of CppCon, this year all virtual and online!

Mesh: Automatically Compacting Your C++ Application's Memory

by Emery Berger

Summary of the talk:

Programs written in C++ can suffer from serious memory fragmentation, leading to low utilization of memory, degraded performance, and application failure due to memory exhaustion. This talk introduces Mesh, a plug-in replacement for malloc that, for the first time, eliminates fragmentation in unmodified C++ applications through compaction. A key challenge is that, unlike in garbage-collected environments, the addresses of allocated objects in C++ are directly exposed to programmers, and applications may do things like stash addresses in integers, and store flags in the low bits of aligned addresses. This hostile environment makes it impossible to safely relocate objects, as the runtime cannot precisely locate and update pointers. Mesh combines novel randomized algorithms with widely-supported virtual memory operations to provably reduce fragmentation, breaking long-established worst-case bounds on memory efficiency with high probability. Mesh generally matches the runtime performance of state-of-the art memory allocators while reducing memory consumption and eliminating pathological cases; in particular, Mesh reduces the memory of consumption of Firefox by 16% and Redis by 39%. There are efforts underway to incorporate Mesh's approach to eliminate fragmentation into existing allocators like tcmalloc and jemalloc; Mesh itself is available at https://github.com/plasma-umass/Mesh, and it can be used just by setting an environment variable.

CppCon 2019: C++20: The small things--Timur Doumler

This year, CppCon 2020 is going virtual. The dates are still the same – September 14-18 – and we are aiming for the CppCon live event to have pretty much everything you’re familiar with at CppCon except moved online: multiple tracks including “back to basics” and a new “embedded” track; live speaker Q&A; live talk time zones friendly to Americas and EMEA (and we’re going to try to arrange around-the-clock recorded repeats in all time zones, where speakers who are available can be available for live Q&A in their repeated talks too, and we’ll do that if it’s possible – but we’re still working on it!); virtual tables where you can interact face-to-face online with other attendees just like at the physical event; virtual exhibitor spaces where you can meet the folks on your favorite product’s teams to ask them question face-to-face; pre- and post-conference classes; and even the CppCon house band playing live before every plenary session. All talk recordings will be freely available as usual on YouTube a month or two after the event, but everything else above will be available only live during CppCon week.

To whet your appetite for this year’s conference, here’s another of the top-rated talks from last year. Enjoy – and register today for CppCon 2020 – all the spirit and flavor of CppCon, this year all virtual and online!

C++20: The small things

by Timur Doumler

Summary of the talk:

C++20 comes with some big new language features: modules, coroutines, concepts, spaceship, and many new libraries. But apart from all those, C++20 also offers many small language improvements, making C++ more powerful and expressive, but also safer and more consistent.

This talk is an overview over all those smaller additions to the core language that will make your life easier. We will discuss much-needed improvements to existing facilities such as lambdas, CTAD, structured bindings, and initialisation, as well as brand-new language utilities that you may not yet have heard about!

CppCon 2019: A Unifying Abstraction for Async in C++--Eric Niebler, David Hollman

This year, CppCon 2020 is going virtual. The dates are still the same – September 14-18 – and we are aiming for the CppCon live event to have pretty much everything you’re familiar with at CppCon except moved online: multiple tracks including “back to basics” and a new “embedded” track; live speaker Q&A; live talk time zones friendly to Americas and EMEA (and we’re going to try to arrange around-the-clock recorded repeats in all time zones, where speakers who are available can be available for live Q&A in their repeated talks too, and we’ll do that if it’s possible – but we’re still working on it!); virtual tables where you can interact face-to-face online with other attendees just like at the physical event; virtual exhibitor spaces where you can meet the folks on your favorite product’s teams to ask them question face-to-face; pre- and post-conference classes; and even the CppCon house band playing live before every plenary session. All talk recordings will be freely available as usual on YouTube a month or two after the event, but everything else above will be available only live during CppCon week.

To whet your appetite for this year’s conference, here’s another of the top-rated talks from last year. Enjoy – and register today for CppCon 2020 – all the spirit and flavor of CppCon, this year all virtual and online!

A Unifying Abstraction for Async in C++

by Eric Niebler, David Hollman

Summary of the talk:

Async in C++ is in a sad state. The standard tools -- promises, futures, threads, locks, and std::async -- are either inefficient, broken, or both. Even worse, there is no standard way to say _where_ work should happen. Parallel algorithms, heterogeneous computing, networking & IO, reactive streams, and more: all critically important foundational technologies that await a standard abstraction for asynchronous computation.

In this talk, Eric Niebler and David Hollman dig into the Standard Committee's search for the basis operations that underpin all asynchronous computation: the long-sought Executor concept. The latest iteration of Executors is based on the Sender/Receiver programming model, which provides a generalization of many existing paradigms in asynchronous programming, including future/promise, message passing, continuation passing, channels, and the observer pattern from reactive programming. It also has surprising and deep connections to coroutines, which further demonstrates the model’s potential to be a truly unifying abstraction for asynchronous programming in C++20 and beyond.

Eric and David will present the short-term and long-term directions for Executors in ISO Standard C++, illustrating the design by walking through several implementation examples. They will talk about the direct connection between coroutines and the Sender/Receiver model and discuss what it means for the future of asynchronous APIs in C++. Finally, they will cover how the restrictions imposed by the Executors model should affect the way you write code today so your code is ready for the next big revolution in parallel and concurrent C++ programming.

CppCon 2019: Everyday Efficiency: In-Place Construction (Back to Basics?)--Ben Deane

This year, CppCon 2020 is going virtual. The dates are still the same – September 14-18 – and we are aiming for the CppCon live event to have pretty much everything you’re familiar with at CppCon except moved online: multiple tracks including “back to basics” and a new “embedded” track; live speaker Q&A; live talk time zones friendly to Americas and EMEA (and we’re going to try to arrange around-the-clock recorded repeats in all time zones, where speakers who are available can be available for live Q&A in their repeated talks too, and we’ll do that if it’s possible – but we’re still working on it!); virtual tables where you can interact face-to-face online with other attendees just like at the physical event; virtual exhibitor spaces where you can meet the folks on your favorite product’s teams to ask them question face-to-face; pre- and post-conference classes; and even the CppCon house band playing live before every plenary session. All talk recordings will be freely available as usual on YouTube a month or two after the event, but everything else above will be available only live during CppCon week.

To whet your appetite for this year’s conference, here’s another of the top-rated talks from last year. Enjoy – and register today for CppCon 2020 – all the spirit and flavor of CppCon, this year all virtual and online!

Everyday Efficiency: In-Place Construction (Back to Basics?)

by Ben Deane

Summary of the talk:

Efficient C++ has always been about minimizing copies. This practically-focused
talk is about how to do that when working with move semantics, perfect
forwarding and STL containers, or non-STL containers that present similar
interfaces.

In-place construction is an easily stated goal, but can be really fiddly to get
right, especially given the foibles of various container interfaces. We'll talk
about copy elision; when to use emplace, insert, or other methods; vectors,
maps, optionals, variants; and how things change from C++11 through C++20.
Attendees will learn why in-place construction is beneficial and exactly how to
achieve optimal efficiency with the various standard container types.

CppCon 2019: 10 Techniques to Understand Existing Code--Jonathan Boccara

This year, CppCon 2020 is going virtual. The dates are still the same – September 14-18 – and we are aiming for the CppCon live event to have pretty much everything you’re familiar with at CppCon except moved online: multiple tracks including “back to basics” and a new “embedded” track; live speaker Q&A; live talk time zones friendly to Americas and EMEA (and we’re going to try to arrange around-the-clock recorded repeats in all time zones, where speakers who are available can be available for live Q&A in their repeated talks too, and we’ll do that if it’s possible – but we’re still working on it!); virtual tables where you can interact face-to-face online with other attendees just like at the physical event; virtual exhibitor spaces where you can meet the folks on your favorite product’s teams to ask them question face-to-face; pre- and post-conference classes; and even the CppCon house band playing live before every plenary session. All talk recordings will be freely available as usual on YouTube a month or two after the event, but everything else above will be available only live during CppCon week.

To whet your appetite for this year’s conference, here’s another of the top-rated talks from last year. Enjoy – and register today for CppCon 2020 – all the spirit and flavor of CppCon, this year all virtual and online!

10 Techniques to Understand Existing Code

by Jonathan Boccara

Summary of the talk:

One of the reasons why a lot of us work in C++ is because there is a huge amount of existing projects written in C++.

But existing code can be hard to understand.

In this presentation, you will learn how to make sense of code quickly, from the general big picture of the codebase all the way down to the little details of the code of a complex class.

The ten rules covered in this session will teach you to:
- start reading code from the end
- identify the parts of code that carry the most information
- locate the code of any feature visible in the application
- and many more!

Code reading techniques usually come with years and years of experience. This presentation will teach some of them to you right now, supported by code examples.

There is a wealth of talks about how to write C++ code using the latest features of the language, but there are very few talks about reading existing code. In particular the everyday code that people have in their codebases. And as the saying goes, code is read much more often than it is written.

This presentation aims at filling this need in a practical way, by exposing 10 techniques that conferences attendees can use on an everyday basis to understand quickly the code they get to work on, as soon as they go back to the office after the conference.

See My Talk: Empty Base Class Optimisation, [[no_unique_address]] and other...--Bartlomiej Filipek

Will you use it?

See My Talk: Empty Base Class Optimisation, [[no_unique_address]] and other C++20 Attributes

by Bartlomiej Filipek

Summary of the talk:

Sometime in 2016, I wrote an article about custom deleters for smart pointers.

Bartek’s coding blog: Custom Deleters for C++ Smart Pointers

And there is an interesting property that if you have a unique_ptr and you provide a stateless functor, then the size of unique_ptr is just one pointer (not two when you use a function pointer). But at that time, I didn’t investigate what the exact reason behind this capability was.

Then in February 2020, I gave a presentation on our C++ User Group about all of the C++20 features. And among them, there’s a new attribute called [[no_unique_address]]. At that time, I also had no clear idea of what were the use cases for it.

But then I wanted to understand more of C++20 and somehow those two features: deleters for unique_ptr and [[no_unique_address]] started to “converge”.

As it appears with the new attribute from C++20, we can significantly simplify the code that leverages Empty Base Class Optimisation to create things like “compressed pairs” often used to store stateless callable objects like allocators or deleters.

CppCon 2019: Naming is Hard: Let's Do Better--Kate Gregory

This year, CppCon 2020 is going virtual. The dates are still the same – September 14-18 – and we are aiming for the CppCon live event to have pretty much everything you’re familiar with at CppCon except moved online: multiple tracks including “back to basics” and a new “embedded” track; live speaker Q&A; live talk time zones friendly to Americas and EMEA (and we’re going to try to arrange around-the-clock recorded repeats in all time zones, where speakers who are available can be available for live Q&A in their repeated talks too, and we’ll do that if it’s possible – but we’re still working on it!); virtual tables where you can interact face-to-face online with other attendees just like at the physical event; virtual exhibitor spaces where you can meet the folks on your favorite product’s teams to ask them question face-to-face; pre- and post-conference classes; and even the CppCon house band playing live before every plenary session. All talk recordings will be freely available as usual on YouTube a month or two after the event, but everything else above will be available only live during CppCon week.

To whet your appetite for this year’s conference, here’s another of the top-rated talks from last year. Enjoy – and register today for CppCon 2020 – all the spirit and flavor of CppCon, this year all virtual and online!

Naming is Hard: Let's Do Better

by Kate Gregory

Summary of the talk:

C++ developers are famously bad at naming: our idioms, guidelines, and lore are rich in examples of terrible names. For example, consider RAII, which stands for scope bound resource management, or west const which perhaps should be const west, or all the samples that feature an object called x which is an instance of a class called X, and so on.

The good news is that naming well is a learned skill, and you can learn it, and start to name better right away. In this talk, I'll tell you why names matter, what benefits a good name can bring, and how to be better at naming. I'll discuss some categories of names and some common decisions within those categories. I'm not going to give you a set of rules to follow: this is about thinking and considering the meaning of the things you are naming. I will give you some questions to ask yourself and some structure that I use to help me to help those who read what I write.

I'll also address renaming things in existing (legacy) code, why and when to do it, and why getting it right the first time may not even be a realistic goal. You should be a lot more confident naming things after we spend this time together.

CppCon 2019: There Are No Zero-cost Abstractions--Chandler Carruth

This year, CppCon 2020 is going virtual. The dates are still the same – September 14-18 – and we are aiming for the CppCon live event to have pretty much everything you’re familiar with at CppCon except moved online: multiple tracks including “back to basics” and a new “embedded” track; live speaker Q&A; live talk time zones friendly to Americas and EMEA (and we’re going to try to arrange around-the-clock recorded repeats in all time zones, where speakers who are available can be available for live Q&A in their repeated talks too, and we’ll do that if it’s possible – but we’re still working on it!); virtual tables where you can interact face-to-face online with other attendees just like at the physical event; virtual exhibitor spaces where you can meet the folks on your favorite product’s teams to ask them question face-to-face; pre- and post-conference classes; and even the CppCon house band playing live before every plenary session. All talk recordings will be freely available as usual on YouTube a month or two after the event, but everything else above will be available only live during CppCon week.

To whet your appetite for this year’s conference, here’s another of the top-rated talks from last year. Enjoy – and register today for CppCon 2020 – all the spirit and flavor of CppCon, this year all virtual and online!

There Are No Zero-cost Abstractions

by Chandler Carruth

Summary of the talk:

C++ is often described as providing zero-cost abstractions. Libraries offer up facilities documented as such. And of course, users read all of these advertisements and believe that the abstractions they are using are truly zero-cost.

Sadly, there is no truth in advertising here, and there are no zero-cost abstractions.

This talk will dive into what we mean by "zero-cost abstractions", and explain why it is at best misleading and at worst completely wrong to describe libraries this way. It will show case studies of where this has led to significant problems in practice as libraries are designed or used in unscalable and unsustainable ways. Finally, it will suggest a different framing and approach for discussing abstraction costs in modern C++ software.

CppCon 2019: Converting to C++20 Modules-Nathan Sidwell

This year, CppCon 2020 is going virtual. The dates are still the same – September 14-18 – and we are aiming for the CppCon live event to have pretty much everything you’re familiar with at CppCon except moved online: multiple tracks including “back to basics” and a new “embedded” track; live speaker Q&A; live talk time zones friendly to Americas and EMEA (and we’re going to try to arrange around-the-clock recorded repeats in all time zones, where speakers who are available can be available for live Q&A in their repeated talks too, and we’ll do that if it’s possible – but we’re still working on it!); virtual tables where you can interact face-to-face online with other attendees just like at the physical event; virtual exhibitor spaces where you can meet the folks on your favorite product’s teams to ask them question face-to-face; pre- and post-conference classes; and even the CppCon house band playing live before every plenary session. All talk recordings will be freely available as usual on YouTube a month or two after the event, but everything else above will be available only live during CppCon week.

To whet your appetite for this year’s conference, here’s another of the top-rated talks from last year. Enjoy – and register today for CppCon 2020 – all the spirit and flavor of CppCon, this year all virtual and online!

Converting to C++20 Modules

by Nathan Sidwell

Summary of the talk:

C++20 will have a module system, which provides benefits beyond simple code hygiene. C++20 modules uses new keywords and explicit source-level annotations. How do we get there from here?

I have been implementing this in the GNU compiler, and will talk about the broad strokes of the module specification.
I will describe how:
* one may incrementally convert source code,
* build systems might be augmented,