The Dark Corner of STL in Cpp : MinMax Algorithms - Šimon Tóth - CppCon 2022
https://github.com/CppCon/CppCon2022
How many problems could one possibly run into when calling a simple algorithm such as std::min?
In this talk, we will take a deep dive into the ergonomics of min-max algorithms and explore several language features in the process:
• reference semantics and lifetime issues
• const correctness and use of const_cast
• costs of using the std::initializer_list
We will finish by exploring the options for addressing these issues when implementing functions with similar semantics.
---
Šimon Tóth
Currently on a mission to share my 20 years' worth of Software Engineering experience with the world.
__
Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk
Contemporary C++ in Action - Daniela Engert - CppCon 2022
This talk is different from typical conference presentations. Instead of focussing on one particular topic I want to take you with me on a journey where I put various pieces from the C++ landscape together into a small application and show how they fit together beautifully. My goal is to debunk the myth that the committee is looking to please experts and library developers instead of making life easier for the many developers in the trenches. This is not slideware, at the end of our tour the code will compile and run with some entertaining result.
On this journey, I will be visiting modules (using modularized popular libraries and others that constitute the app), do some network cppcon.digital-medium.co.uk/tag/programming/">programming with coroutines (based on ASIO executors, as there are no C++ standard executors yet), slip in one or two of the flagship C++23 features, like explicit object parameters or some of the new library stuff, and season the stew with items from recent C++ standards. It's a tiny application using techniques that an average programmer in the embedded or industrial world (like me) might find useful. The code I'll show also contains very tiny fragments of condensed or simplified sources in active development taken from our in-house codebase - old and trusted, but thrust into the modern age.
If time permits, I will detour a little into modules and show the options that C++20 gives you to create and compose your own modules. For that matter, almost every module translation unit type is present in the demo code to look at how these things can be done in practice. A second insert is a discussion of the object lifetime safety that coroutines can offer when composed well, and how important cancellation is.
---
Daniela Engert
Daniela has a degree in electrical engineering and has been working for more than 30 years in small innovative companies in the field of software and hardware development. She has spent her youth with exploring the very first microprocessors since the late 70's, and has been creating software professionally for 40 years now. After a long time using many different cppcon.digital-medium.co.uk/tag/programming/">programming languages, C++ has now been the exclusive workhorse throughout the last two decades. With great pleasure Daniela is now also a member of the ISO C++ committee. For the better part of her career, the domain was applied digital signal processing (medicine, metrology, reconnaissance), but during the last decade the focus shifted onto special engineering in the field of industrial non-destructive testing of semi-finished and finished steel products using ultrasound. Besides that, she loves to relax with hard metal and soft cheese, hot curries and cool jazz.
---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk
A Faster Serialization Library Based on Compile-time Reflection and C++ 20 - Yu Qi - CppCon 2022
https://github.com/CppCon/CppCon2022
A serialization library based on compile-time reflection and C++20 is much more easier to use than protobuf and msgpack, no DSL definition, no macros and no invasive because of c++ 20.
The library is 3x faster than msgpack and protobuf, even hundreds times faster in some special scene, how to do it?
1. How to reflect an object with c++20;
2. Design a parsing faster data formats utilize static reflection;
3. Do special optimization for trivial copyable objects according to static reflection;
4. Compile time type hash make binary data size smaller and deserialization more safe;
5. std::optional can help to keep backward compatibility;
The talk will cover above points.
---
Yu Qi
Yu is a C++ programmer with 15 years experience who lives in Hangzhou, Zhejiang province, China. He loves modern C++ and has founded an open source community ( http://www.purecpp.cn/ ) to promote modern C++ in China. His focus is distributed systems and he is the author of rest_rpc, an RPC library implemented in C++14. Yu's github is https://github.com/qicosmos . Yu wrote a Chinese language book about C++11 in 2015: http://item.jd.com/11701870.html The title translates as "C++11 In Depth."
---
Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk
Breaking Dependencies - C++ Type Erasure - The Implementation Details - Klaus Iglberger - CppCon 2022
https://github.com/CppCon/CppCon2022
“If I could go back in time and had the power to change C++, rather than adding virtual function, I would add language support for Type Erasure …” (Eric Niebler, June 19, 2020, Twitter).
For many developers Type Erasure is superior to inheritance with respect to dependency management. And indeed, it has proven itself to be a powerful design pattern, helping to significantly reduce coupling between software entities. Unfortunately, there is no language support for Type Erasure (yet) and many shy away from the seemingly complex implementation details.
In this talk I will give advice on the different ways of how to implement Type Erasure. I’ll start with two very simple, ~20 line implementations for owning and non-owning Type Erasure Wrappers. But I’ll also go into detail about different performance optimization strategies, such as the manual implementation of virtual functions and the Small Buffer Optimization (SBO). After this talk, attendees will know everything to realize and utilize Type Erasure in their own code bases.
---
Klaus Iglberger
Klaus Iglberger is a freelance C++ trainer and consultant. He has finished his PhD in Computer Science in 2010 and since then is focused on large-scale C++ software design. He shares his expertise in popular advanced C++ courses around the world (mainly in Germany, but also in the rest of the EU and the US). Additionally, he is the initiator and lead designer of the Blaze C++ math library (https://bitbucket.org/blaze-lib/blaze/), one of the organizers of the Munich C++ user group (https://www.meetup.com/MUCplusplus/), and the organizer of the Back-to-Basics track at CppCon.
---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk
SIMDString for Computer Graphics in C++ - Zander Majercik and Morgan McGuire - CppCon 2022
https://github.com/CppCon/CppCon2022
Video games and other real-time 3D graphics use a surprising number of C++ text strings, and need them to be fast. For example, strings are tags for language localization, UI elements, variable names for binding to GPU shaders and CPU interpreted scripts, and snippets for runtime code generation in those languages.
Our open source SIMDString class is a drop-in replacement for std::string optimized for graphics applications, which tend to perform a lot of copy construction and concatenation on relatively small strings. SIMDString was originally created for x86 and x64 desktop in the G3D Innovation Engine and later generalized for ARM edge and mobile at NVIDIA and Roblox. Versions have been in production use for a decade now.
SIMDString embeds short strings in the class to reduce heap allocation, intentionally aliases immutable const-segment strings, uses a freelist optimized allocator, leverages SIMD instructions, and has several micro-optimizations for good performance on all platforms. It is >5x faster than std::string and outperforms the previous optimized strings released by Facebook and Electronic Arts on which it builds.
In this talk we introduce SIMDString with a detailed case study of its performance when working with GPU shaders. We review the various optimizations one could use for strings and show why the ones employed in SIMDString are a good combination for graphics–as well as why some seemingly good ideas are actually inefficient in this application. We conclude with benchmark results for multiple string classes showing the tradeoffs between implementations.
---
Zander Majercik
Zander Majercik is a Research Scientist at NVIDIA. His main research interest is novel rendering algorithms with a focus on ray-tracing. He has also worked on projects in vision science, novel display technologies for XR systems, and deep learning algorithms. He graduated from Williams College with a BA in Computer Science.
---
Morgan McGuire
Morgan McGuire is the Chief Scientist at Roblox, channeling and accelerating innovation across the company to build a creative, safe, civil, and scalable Metaverse. Roblox combines social interaction with a dynamic 3D environment and economy, with research impact spanning both technology and social sciences.
Morgan is also known for previous work as a professor, game developer, and industry researcher. As Director of Hyperscale Graphics Research at NVIDIA, Morgan accelerated cloud graphics, esports, ray tracing, and augmented and virtual reality. Morgan's product work includes the NVIDIA RTXGI and Reflex SDKs and RTX GPUs; the Skylanders®, Call of Duty®, Marvel Ultimate Alliance®, and Titan Quest® series of video games series; the Unity game engine; the E Ink display used in the Amazon Kindle®; and the PeakStream high performance computing architecture acquired by Google. Morgan's scientific publications and patents span many areas of computer science, from compilers and networking to 3D graphics.
Morgan cochaired the EuroGraphics Symposium on Rendering, the ACM SIGGRAPH Symposium on Interactive 3D Graphics and Games, the ACM SIGGRAPH Symposium on Non-Photorealistic Animation and Rendering, and the ACM SIGGRAPH / EuroGraphics High Performance Rendering conference, and was the founding Editor-in-Chief of the Journal of Computer Graphics Techniques. Morgan is the author or coauthor of “the bible” of 3D, Computer Graphics: Principles & Practice 3rd Edition, The Graphics Codex, Creating Games, the G3D Innovation Engine, the Markdeep document system, and chapters of several GPU Gems, ShaderX, and GPU Pro volumes.
Morgan holds faculty positions at the University of Waterloo and McGill University and was a full professor at Williams College. Morgan received Ph.D. and M.S. degrees from Brown University and M.Eng. and B.S. degrees from MIT.
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk
GPU Performance Portability Using Standard C++ with SYCL - Hugh Delaney & Rod Burns - CppCon 2022
https://github.com/CppCon/CppCon2022
The proliferation of accelerators, in particular GPUs, over the past decade is impacting the way software is being developed. Most developers who have been using CPU based machines are now considering how it's possible to improve the performance of applications by offloading execution to many core processors. Many emerging disciplines including AI, deep neural networks and machine learning have shown that GPUs can increase performance by many times compared to CPU-only architectures. New hardware features such as "tensor cores" are also starting to emerge to address specific problems including mixed precision computing. The new challenge for developers is figuring out how to develop for heterogeneous architectures that include GPUs made by different companies. Currently the most common way to develop software for GPUs is using the CUDA programming model but this has pitfalls. CUDA uses non-standard C++ syntax and semantics, is a proprietary interface, and can only be used to target Nvidia GPUs. Alternatives include HIP which offers another proprietary programming interface only capable of targetting AMD GPUs.
This presentation will demonstrate how standard C++ code with SYCL can be used to achieve performance portability on processors from multiple vendors including Nvidia GPUs, AMD GPUs and Intel GPUs. The SYCL programming interface is a royalty free and industry defined open standard designed to enable the latest features of accelerators. Using an open source project, we'll show how standard C++ syntax and semantics are used to define the SYCL kernel and memory management code required to offload parallel execution to a range of GPUs. Further to this, we'll explain how easy it is to compile this C++ code using a SYCL compiler so that it can be run on Nvidia, AMD and Intel GPUs and compare this execution performance with the same code written using proprietary CUDA and HIP environments. Lastly we'll share our tips for achieving the best performance on different processor architectures, including dealing with varying memory resources, using the most appropriate memory access patterns, using hardware specific features such as "tensor cores" and ensuring high utilization of the processor cores.
---
Rod Burns
Rod Burns has been helping developers to build complex software for well over a decade with experience in organizing training, tutorials and workshops. At Codeplay Rod leads the effort to support and educate developers using SYCL. Rod helped to create “SYCL Academy,” an open source set of materials for teaching SYCL, that have already been adopted by some of the top universities in the world and has been used at multiple conferences to teach SYCL.
---
Hugh Delaney
Hugh is a software engineer at Codeplay, where he works on the DPC++ compiler. Hugh’s academic background is in mathematics and HPC with a focus on numerical algorithms and linear algebra. Hugh has been teaching mathematics and computing in some manner for all of his adult life.
---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk
Back to Basics: Master C++ Value Categories With Standard Tools - Inbal Levi - CppCon 2022
https://github.com/CppCon/CppCon2022
Value categories are deeply ingrained in the C++ language.
Though as a beginner they might seem almost insignificant, the importance of having a proficient understanding of them increases as one gets deeper into library writing or generic code, but also when writing an application level code.
In the talk we will go over changes made to value categories during C++ versions, and explore the standard tools used to achieve the desired behavior in your code
---
Inbal Levi
Inbal Levi is a Senior Software Engineer with a passion for software design, software development lifecycle, and high performance.
She is a director of the ISO C++ foundation and an active member of the C++ Standards Committee as co-chair of Library Evolution, the chair of SG9 (Ranges group), and the chair of the ISO C++ Israeli NB. Inbal is also an organizer of the CoreCpp conference and user group.
---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk
From C++ Templates to C++ Concepts - The Amazing Journey of Metaprogramming - Alex Dathskovsky - CppCon 2022
https://github.com/CppCon/CppCon2022
Metaprogramming is been with us since C++98 but as the language evolves we have more tools and the code get simpler and clearer. In this talk we will cover the history of Templates and how the usage and readability became clearer and simpler with each standard. We will develop a concept with c++11-c++17 for checking if a type is container and then we will discover how c++20 concepts make the whole thing much easier.
In this talk we will cover the grounds of Template meta programming with quick walkthrough of how templates work and how template metaprogramming has evolved with every C++ standard. The talk will have present the evolution and benefits with many code examples. The larges example will be the development of a concept for Containers and how it is simplified with Concepts.
---
Alex Dathskovsky
Alex has over 16 years of software development experience, working on systems, low-level generic tools and high-level applications. Alex has worked as an integration/software developer at Elbit, senior software developer at Rafael, technical leader at Axxana, Software manager at Abbott Israel and now a group manager a technical manager at Speedata.io an Exciting startup the will change Big Data and analytics as we know it .On His current Job Alex is developing a new CPU/APU system working with C++20, Massive metaprogramming and development of LLVM to create the next Big thing for Big Data.
Alex is a C++ expert with a strong experience in template meta-programming. Alex also teaches a course about the new features of modern C++, trying to motivate companies to move to the latest standards.
__
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk
Introduction to Hardware Efficiency C++ - Ivica Bogosavljevic - CppCon 2022
https://github.com/CppCon/CppCon2022
Not all programs are created equally: some use hardware resources optimally, others not so much. In this lecture we will talk about two basic types of hardware bottlenecks: the CPU bottleneck and the memory bottleneck. We will give information how to recognize if your code is memory bound or CPU bound and some ideas on how to overcome these limitations.
If the session is two hours long then we add the following description:
We will also talk about instruction level parallelism: what is instruction level parallelism, how it is connected to your program's performance, and how to improve your program's speed by increasing instruction level parallelism.
All the examples will be given in C++.
---
Ivica Bogosavljevic
Senior Software Engineer with 10 years of experience active in the domain of Linux and bare-metal embedded systems. His professional focus is application performance improvement - techniques used to make your C/C++ program run faster by using better algorithms, better exploiting the underlying hardware, and better usage of the standard library, programming language, and the operating system. Writer for a performance-related tech blog: https://johnysswlab.com]
---
Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk
The Most Important Optimizations to Apply in Your C++ Programs - Jan Bielak - CppCon 2022
https://github.com/CppCon/CppCon2022
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 optimisation 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 pessimisations” 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.
---
Jan Bielak
Jan Bielak is a student at the Warsaw Staszic High School. His main areas of interest are physics and computer science. He is especially into advanced C++ cppcon.digital-medium.co.uk/tag/programming/">programming and physically based real-time rendering. He also hosts and educational YouTube channel. He is involved in the CyberDuck project and in the PaSh project. In free time, he likes to create renders in Blender.