CPPCON2020 Plenary Session Review: Performance Matters

This was my favorite session. I must confess that I’ve seen it three times, and had the time to go slowly over the topic discussed: performance.

Emery Berger needs no introduction. Just check his LinkedIn profile, but just in case, his credentials are at the beginning of the session and just the fact that the CPPCON organizers scheduled him for a plenary session is telling: He’s got the goods.

What made this session useful and memorable? On one hand, Emery supports the topic of performance taking a meticulous approach supported by sound math, statistics, data, you name it. At the end of the post I add references that are mentioned in the session.

Chillax, have a mojito

Emery starts the session with a simple example: performance of a given system in the ’70’s, cool ’80’s, and today, but soon things get super interesting. In the past, you gained performance just by…upgrading your computer, right? Of course! Who doesn’t remember those Gateway 486SX computers with 4MB of RAM (and don’t make me go to 386SX, 80286, 8086…)

Moore’s Law right? Dennard’s Scaling, correcto?

Well, with the advent of multicore/manycore processors, things changed, and for the better.

Gains in performance cannot be stated by “I ran it once and it ran better”. Given two systems, A and A’, if A’ performs better and making a claim, what is the reason? Our typical approach is to find opportunities for better code, but why? It shouldn’t be black magic, right?

So, without spilling the beans, this is what you will learn from the session:

  • Variance when there are factors that may affect performance
  • Data Layout (from code to how it’s really laid out in memory)
  • Link order and its impact on function addresses
  • Environment variable size (moves program stack)
  • Changing libraries
  • Running a program in a new directory and its impact on layout

Make sure you check the reference he makes to Producing Wrong Data Without Doing Anything Obviously Wrong!

Furthermore, Emery will introduce you to randomization as a way to eliminate the effect of layout with the Stabilizer tool, and how it eliminates the layout bias. In this section of the talk he references Null Hypothesis, Central Limit Theorem, Student’s t-test and Analysis of Variance (ANOVA), so be ready to do some reading.

Moreover, Emery introduces causal profile and Coz, and how to approach a performance problem. What he exposed reminded me of Control Theory with a feedback loop. I asked Emery in a follow up Q&A about the difference between BPF and Coz, and he mentioned that BPF is an observing tool, while Coz is a predicting tool. I would think they would be a great complement to each other. On verra.

In this section of the talk you’ll be introduced to:

  • Experimentation and what slowing down a component reveals
  • Latency and throughput

My favorite reference was Little’s Law, which I have used exactly twice in previous projects. A specific resource where it is mentioned–and used–is in Windows Server 2003 Resource Kit: Performance Guide.

Hopefully I got you interested in this session. If you have an hour to chillax with a mojito, I encourage you to check this session. You’ll derive hours of satisfaction following up the papers and putting into practice what you learn.

Word of the Conference

Many of the sessions, such as Emery’s plenary session, and Herb Sutter’s capstone plenary session, make use of the word incantation. Presenters use it to present a non-apparent solution to a given problem. It seems that every CPPCON conference I’ve attended there’s a catchy phrase. We’ll see what next year brings.


This entry was posted in C++, C++17, C++20, performance, software and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s