News

CppCon 2023 Cache-friendly Design in Robot Path Planning -- Brian Cairl

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

Cache-friendly Design in Robot Path Planning

Monday, October 2 • 17:20 - 17:55

by Brian Cairl

Summary of the talk:

Point-to-point planning is a major component in virtually all mobile robotic systems. These systems may require agents to generate paths over very large areas on demand; and sometimes several more times during their journey as part of intelligent recovery routines under dynamic environmental conditions. Since planning over large areas is a resource-intensive operation, particularly in higher-dimensional state-spaces, planning routines must be carefully tuned to execute as efficiently as possible so as to prevent perceptible delays in robot responsiveness.

Attendees can expect an overview of common planning algorithms used in robotics, such as Dijkstra's and A-star, to provide a motivating context. Rather than focus on time saving tricks specific to a particular environment or robot morphology, we will instead focus on getting the most out of these algorithms by way of leveraging cache-friendly design of requisite graph and memoization structures; and memory layouts. In particular, we will focus on achieving these results using common C++ STL facilities; and compile-time facilities to promote generic design, where possible. Finally, we will provide comparisons between naive and cache-optimized implementations; and guides for effectively profiling these algorithms for system-specific tuning purposes.

CppCon 2023 Effective Ranges: A Tutorial for Using C++2x Ranges -- Jeff Garland

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

Effective Ranges: A Tutorial for Using C++2x Ranges

Monday, October 2 • 16:45 - 17:45

by Jeff Garland

Summary of the talk:

This course provides in introduction to using C++ ranges effectively. Ranges are the largest revamp of the Standard Template Library (STL) in 20 years and impacts daily C++ programming dramatically. The presentation provides a survey of C++20 and C++23 ranges and their application. Note that C++14/17 programmers can also benefit since Range v3 library provides an implementation of many of the discussed facilities.

The tutorial goes beyond the basics to explore what's behind the ranges library. For example, understand the key differences between algorithms and views and when to apply them. We'll look at some of the concepts used in the design of ranges. And finally we'll explore how ranges fits into the wider standard library with i/o integration, collection integration, and support of legacy stl algorithms.

Chock full of example code this tutorial will bootstrap programmer's usage of std::ranges.

CppCon 2023 Your Performance Todo List 2: Maintaining Performance Scalability... -- Jan Bielak

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

Your Performance Todo List 2: Maintaining Performance Scalability and Avoiding Bottlenecks

Tuesday, October 3 • 09:00 - 10:00

by Jan Bielak

Summary of the talk:

Writing efficient programs is hard. This is because it requires a lot of knowledge, experience and strategic thinking. There have been many talks on optimization and often each addresses a single concept. Being able to achieve a bird’s eye view of factors affecting performance often requires many hours of researching the topic. To lessen the mental burden of optimizing programs, I have picked out the techniques, I believe are most important. During the talk, I will present them in an organized manner and provide practical examples of how they can be applied.

I will first discuss what I believe are the main goals efficient programs strive to achieve. Then, I will present the general methods of achieving those goals. Then, for the majority of the talk, we will discuss a few dozen performance opportunities. For each of them, I will explain the underlying mechanism of how the optimization works. I will avoid bluntly giving guidelines to follow without explanation. Each of the techniques naturally comes with its costs, and those will be discussed as well.

I will additionally discuss various performance pitfalls. These are sometimes called “premature pessimizations” in contrast to the often used term of “premature optimizations”. I will show examples of optimizations which do not incur any cost on program readability or maintainability and as such should be considered performance best practices. Avoiding their use doesn’t improve code in any manner, while making it slower.

This talk is intended for a diverse audience, as, after all, probably most of the C++ community is interested in performance. It is appropriate for hobbyists and professionals alike, with varying experience with the language, due to the gradual increase in difficulty of examples. It will be a time productively spent.

----

This presentation builds upon "Your Performance Todo List", from last year's conference (30k+ views, 8th most viewed). It will serve as an extension to its material, by revisiting certain topics and explaining them in more detail as well as by providing more examples of techniques and their applications. Specifically, it will first provide a more in-depth and illustrative view of various microarchitectural details and their impact on performance, as well as of relevant optimizations:
* branch prediction and speculative execution,
* pipelining and out of order execution,
* vectorization and SIMD processing,
* cache and memory functioning and intercommunication.

Then, the talk will focus on the topics emerging as being the most crucial to maintaining performance scalability - parallelism and concurrency. I will ground multithreading concepts, like atomics, memory barriers, and other synchronization primitives, in the context of both the theoretical C++ memory model as well as specific cache coherency protocols.

I will also discuss the interactions between a user-space application and the underlying operating system as well as their effects on performance.

CppCon 2023 Plug-in Based Software Architecture for Robotics -- Abishalini Sivaraman

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

Plug-in Based Software Architecture for Robotics

Monday, October 2 • 16:45 - 17:15

by Abishalini Sivaraman

Abishalini Sivaraman holds a bachelors and masters degree in electrical and computer engineering from Texas A&M University. She has worked on various robotics projects as part of school and work in the last 5 years.

CppCon 2023 Thinking Functionally in C++ -- Brian Ruth

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

Thinking Functionally in C++

Monday, October 2 • 15:15 - 16:15

by Brian Ruth

Summary of the talk:

C++ is a multi-paradigm language, supporting OO, procedural and functional programming styles. Functional languages conjure up thoughts of academic languages; immutable data and mathematical terms like monad and higher order functions. We’ve been told of the advantages of functional languages, specifically when it comes to parallelization and safety, but very few of them are ever used in production code. However, what if we were to take the mindset of functional programming and apply it to existing C++ codebases? How will it change the way we write and think about our code? In this talk, we will explore ways to think functionally about your code and how to modify it using functional techniques. We will explore some of the additions C++ has made to aid in functional programming in the form of views, lambdas and ranges and how those fit into an existing OO or procedural codebase. We will finish up by looking at functional design considerations and their tradeoffs. After leaving this talk you should have the tools to identify instances in your code where using functional thinking will improve its performance, reusability and security.

CppCon 2023 C++ Modules: Getting Started Today -- Andreas Weis

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

C++ Modules: Getting Started Today

Monday, October 2 • 15:15 - 16:15

by Andreas Weis

Summary of the talk:

Modules have been one of the most highly anticipated features of C++20. Unfortunately, it was also the language feature that took the longest to become widely available for developers to use. This year, for the first time, we see broad support for the feature in all major compilers and mainstream build system support through CMake. The goal of this talk is to provide you with all the basic knowledge to allow you getting started with C++20 modules today.

We will take a look at how modules change the build process and why it took so long to implement them. We will take a tour of the essentials of the named modules mechanism and explore the new best practices for physical code structure in a modules-based code base, including how to set up a build with CMake. And last but not least, we will discuss different options for interacting with existing header-based code.

The talk will focus above all else on practicality: We will only be covering features that are widely available for use today with the latest compilers and build tools. We will give special attention to the areas where the design practices for modules differ from the familiar header-based approach and address common misconceptions and pitfalls that are typical among developers first encountering the feature. No prior knowledge of modules is required.

CppCon 2023 std::simd: How to Express Inherent Parallelism Efficiently Via ... -- Matthias Kretz

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

std::simd: How to Express Inherent Parallelism Efficiently Via Data-parallel Types

Monday, October 2 • 15:15 - 16:15

by Matthias Kretz

Summary of the talk:

C++26 is on route to ship `std::simd`, a facility for expressing data-parallelism via the type system, based on experience from `std::experimental::simd` (Parallelism TS v2). Data-parallel types have the potential to replace many uses of built-in arithmetic types with their `simd` counterpart in compute-intensive workloads, promising factors of speed-ups without algorithmic changes.

This talk presents how data-parallel types are designed to be more than just a thin wrapper around SIMD registers and instructions. They are designed to facilitate generic code, work/integrate with standard algorithms, etc, all while translating into efficient use of parallel execution capabilities. More important, data-parallel types are not "just another way to express data-parallel execution", they also provide new ways to design data structures for efficient memory access (high-throughput without sacrificing locality) using data-structure vectorization. The talk features examples of efficient use of `std::simd`.

Five Advanced Initialization Techniques in C++ -- Bartlomiej Filipek

cppstories-5advinit-fi.pngFrom dynamic container operations to compile-time constants, C++ offers a variety of techniques. In this article, we’ll delve into advanced initialization methods likereserve() and emplace_backfor containers to tuples with piecewise_construct and forward_as_tuple. Thanks to those techniques, we can reduce the number of temporary objects and create variables more efficiently.

Five Advanced Initialization Techniques in C++: From reserve() to piecewise_construct and More

By Bartlomiej Filipek

From the article:

As a background, we can use the following class that will be handy to illustrate when its special member functions are called. That way, we’ll be able to see extra temporary objects.

 

CppCon 2023 Continuous Regression Testing for Safer and Faster Refactoring -- Pejman Ghorbanzade

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

Continuous Regression Testing for Safer and Faster Refactoring

Monday, October 2 • 15:15 - 16:15

by Pejman Ghorbanzade

Summary of the talk:

Making code changes to real-world software systems runs the risk of introducing unintended side-effects that are costly to find and fix. To mitigate this risk, engineering teams significantly invest in adopting various software testing practices. Despite best efforts, effectively and reliably identifying software regressions remains a challenge and results in long feedback cycles that hurt developer productivity. This problem is more pronounced in C++ software systems, given that their application domains often impose tight requirements on system safety and performance.

This talk shows you how continuous regression testing can help you find regressions in behavior or performance of your software during the development stage. It is a practical walk-through of how to build a regression testing framework in C++, how to use it to write effective regression tests, and how to integrate it with your CI pipeline to automate the execution of your tests as part of the CI or on a dedicated test server. It also includes recommendations on how to avoid common design pitfalls that lead to tests that are either flaky or untrustworthy or difficult to run at scale.

This talk also introduces a free and open-source software for continuous regression testing C++ applications. We will use a series of hands-on demos to showcase the end-to-end workflow of finding regressions in common C++ development scenarios including refactoring functions, upgrading dependencies, and updating the build toolchain. We also show a few less common use-cases such as profiling the size of binaries and tracking the exported symbols of a shared library, to inspire you to think how regression testing could unlock faster and safer refactoring for you and your team.

CppCon 2023 Abstraction Patterns for Cross Platform Development -- Al-Afiq Yeong

Registration is now open for CppCon 2023! The conference starts on October 1 and will be held in person in Aurora, CO. To whet your appetite for this year’s conference, we’re posting some upcoming talks that you will be able to attend this year. Here’s another CppCon future talk we hope you will enjoy – and register today for CppCon 2023!

Abstraction Patterns for Cross Platform Development

Monday, October 2 • 14:00 - 15:00

by Al-Afiq Yeong

Summary of the talk:

Writing code that's intended to work across multiple platforms; be it hardware, graphics APIs, online storefronts or operating systems can be rather difficult. Many software engineers struggle when it comes to abstracting code especially junior engineers be it for a commercial software or a hobby project. To make matters worse, there's often not a lot of materials covering such as advance topic. This presentation aims to discuss several abstraction patterns that can be used to write cross platform code using the features and tools that C++ and operating system offers, from the bad to the good as well as the benefits and pitfalls of each method in terms of complexity, maintainability and performance. A case study of several cross-platform frameworks will also be included in the presentation. Hopefully this presentation will serve as a starting point and become the main reference for engineers across multiple experience levels across various industries when writing cross platform code.