Skip to content

Type Punning and Counting Nanoseconds

Photo of Phil Nash
Hosted By
Phil N. and 2 others
Type Punning and Counting Nanoseconds

Details

This month we welcome back Timur Doumler who will talk to us about Type Punning, and David Gross, talking about micro-benchmarking.

This event is sponsored by Optiver, who will be providing free pizza and drinks at the bar! (https://www.optiver.com/eu/en/). As a result please note the slightly earlier start time.

>>>>>>>>>>>>>>>>>>>
Important: please also register on the Skills Matter page in order to gain access:
https://skillsmatter.com/meetups/12724-c-plus-plus-london-september
<<<<<<<<<<<<<<<<<<<

Agenda:

18:30 Phil Nash - "Intro and News"

18:40: David Gross - "Counting nanoseconds: Micro-benchmarking C++ code"

"If you don't benchmark your code, you don't care about its performance." Chandler Carruth

Benchmarking our code matters when we care about its speed. While it seems simple to use Google Benchmark and run a benchmark, there are many
pitfalls and getting accurate results from a benchmark isn't an easy task. What to measure first? How comparable are the first
and the thousandth iterations of our benchmark? What if we have to measure the speed of only one line of code? What are the limits of
our measurements?

19:30: Break for pizza & drinks - thanks to Optiver!

19:50: Timur Doumler - "Type punning in modern C++"

Type punning is often used in C++ for fast floating-point math, deserialising C++ objects from a sequence of bytes, and other purposes. Popular techniques involve unions, reinterpret_cast, and memcpy. C++20 provides new useful tools, such as bit_cast. And there are proposals to provide even better control over C++ object creation in the future.

This talk is a comprehensive overview of all of these techniques. We will discuss when and how they can be used safely without causing undefined behaviour, what C++ does and does not allow you to do (and why), existing holes in the C++ language, and how to fix them. In the process, we will cover important C++ concepts such as object lifetime, value representations, and aliasing rules

---

About the speakers:

David is an enthusiastic C++ developer with an emphasis on performance, He is measuring nanoseconds at work (and at home). At Optiver, he’s writing automated trading systems for options and teaches Modern C++ to his colleagues

Timur is a C++ developer specializing in audio and music technology, an active member of the ISO C++ committee, and part of the #include < C++ > team. He is passionate about building communities, clean code, good tools, and the evolution of C++.

Photo of C++ London group
C++ London
See more events
Skills Matter | Code Node
10 South Place EC2M 2RB · London