Category: Science & Technology

Code Size Compiler Optimizations and Techniques for Embedded Systems – Aditya Kumar – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Code size of embedded application has been a concern for a very long time. While storage becomes cheaper and smaller, developers find creative ways to increase code size by adding features or unnecessary software engineering. Compilers have come a long way in optimizing applications for code size. While most compiler optimization work were focused on application performance, we have seen increase in the code size optimizations in recent years.

In this presentation I'll talk about classical as well as recent compiler optimizations for code size, a few of which I implemented in the LLVM compiler. Some optimizations (hot cold splitting, function entry instrumentation) require collecting data from the field while the application is running. I'll provide an overview of how those compiler techniques help reduce code size. I'll also talk about some tips and techniques (compiler flags to reduce code size, tuning of compiler options like inline threshold), that help reduce binary size. Having knowledge of the code generated by the compiler and the instruction set architecture can help engineers chose appropriate programming abstractions and idioms.

Key takeaways:
- Compiler optimization flags and tunings for code size optimizations
- Selecting code-size friendly data structures and algorithms from the C++ standard library
- Source code level optimization and annotation techniques to reduce binary size
- Compiler instrumentation techniques to get insights into the source code
- Software re-organization techniques to reduce working set during program startup

---
Aditya Kumar

I've been working on LLVM since 2012. I've contributed to modern compiler optimizations like GVNHoist, Hot Cold Splitting, Hexagon specific optimizations, clang static analyzer, libcxx, libstdc++, and graphite framework of gcc.

---
Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Debugging Assembly Language and GPU Kernels in Visual Studio Code – Julia Reid – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
In this session, you’ll learn how to take advantage of VS Code’s new debugging capabilities and discover easy ways to boost your C++ development productivity along the way.

We’ll get a simple embedded project up and running on a Raspberry Pi using the CMake Tools extension for Visual Studio Code. Then, we’ll dive deep into a debugging session, digging into both source code and assembly language. Next, we’ll debug GPU kernels in VS Code using NVIDIA’s Nsight Visual Studio Code Edition extension.

You’ll walk away from this talk with the knowledge and tools to take advantage of all VS Code’s debugger has to offer, along with bonus tips about optimizing productivity in C++ development regardless of which editor or IDE you’re using.

---
Julia Reid

Julia is a program manager on the Visual C++ team at Microsoft, focusing specifically on Visual Studio Code. Because Julia comes from a background of C++ development, she has a passion for enhancing and simplifying C++ development experiences for programmers of all levels. Within Visual Studio Code, Julia focuses specifically on the C++ extension.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Custom Views for the Rest of Us – Jacob Rice – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
C++20's views are an exciting and powerful new feature, and while the standard includes several views to get you started, there is plenty of room for improvement. Third-party libraries such as range-v3 can help, but how hard would it be to write one for your own application?

This talk will provide an introduction to how views work, along with solutions to common problems that you may encounter when trying to implement your own views. It will also go into some depth on a few of the shortcomings in the C++20 implementation of views and how they can be improved in future versions, as well as some possible workarounds that you can use in the meantime.

---
Jacob Rice

Jacob is a software engineer for Keysight Technologies in Colorado Springs, CO. He specializes in legacy code modernization, template library utility design, and system architecture. While he is a proponent of clean code in the workplace, he's also a big fan of esoteric and overly complex template metaprogramming code in his free time.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

C++20’s <chrono> Calendars and Time Zones in MSVC – Miya Natsuhara – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---

The <chrono> header has existed since C++11, but C++20 dramatically increased its capabilities. MSVC has completed this C++20 feature and this session will focus on the development of our implementation and Windows-specific considerations that we encountered. For instance, how do we know if a given point in time is during a leap second insertion? Where do we get the data for time zones? If you are excited by these new chrono features and want to support a Windows platform, come and learn about its developments and caveats for a Windows implementation!

We will also touch on how STL maintainers and our valued external contributors developed the new features collaboratively. If you’re interested in participating in our open-source repo by reporting issues, contributing to discussions, or submitting pull requests, we hope that hearing about an example of collaboration will encourage you to visit our repo in the future.

---

Miya Natsuhara

Software Engineer, Microsoft

---
Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

“unit”_test: Implementing a Macro-free Unit Testing Framework from Scratch in C++20 – Kris Jusiak

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Testing in C++ is not easy, it often requires a lot of boilerplate code, macro usage, and/or understanding of complicated testing frameworks.
But it doesn't have to be like that. C++20 will enable us to reinvent the way we write tests!

In this case study, we will address the difficulty of testing with C++ by implementing a new, fully functional, macro-free testing framework 1 from scratch with modern C++20 features to make the following snippet compile and run:

01 import ut;
02
03 int main() {
04 "fib"_test = [] { // Running "fib"...
05 12_i == fib(7); // fib.cpp:5:FAILED [ 12 == 13 ]
06 }; // tests: 1 | 1 failed
07 } // asserts: 1 | 0 passed | 1 failed

At the end of this session, the audience will have a better understanding of C++20 features such as:
- Modules
- Concepts
- Source Location
- New additions to lambdas
- User-Defined Literals

Additionally, attendees will get familiar with an expressive way of testing with modern C++ based on UT - Unit Testing Framework [2].

Let's get ready to follow the Beyonce rule - 'If you liked it then you "should put a"_test on it' and test all the things at CppCon 2021!

[1]: https://godbolt.org/z/Kr4PPexsM
[2]: https://github.com/boost-ext/ut

---
Kris Jusiak

Kris is a Software Architect passionate about programming and who has worked in different industries over the years including telecommunications, games and most recently finance for Quantlab Financial, LLC. He has an interest in modern C++ development with a focus on performance and quality. He is an open-source enthusiast with multiple open-source libraries where he uses template meta-programming techniques to support the C++ rule - "Don't pay for what you don't use" whilst trying to be as declarative as possible with a help of domain-specific languages. Kris is also a keen advocate of extreme programming techniques, Test/Behavior Driven Development and truly believes that 'the only way to go fast is to go well!'.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Back To Basics: Debugging Techniques – Bob Steagall – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Finding and correcting defects in our code (aka bugs) is often a time-consuming, tedious, and challenging task. As the size and complexity of our code bases grows, it can feel like the corresponding difficulty in finding and understanding defects is growing exponentially. And yet, defects continue to arise, and we must continue to fix them.

This talk will look at what debugging is, the role of debugging in our development processes, and some of the many challenges associated with debugging. We'll look at the kinds of defects that debugging can address, and examine a number of strategies, tools, and tips for tracking them down. Finally, we'll provide some guidance for what to do after you've found the problem.

If you've ever faced a challenging bug, and wished for a more complete set of tools for finding it, then this session is for you. Attendees will leave this session with a basic set of debugging tips, tools, and tricks that they can immediately apply to their own daily work.

---
Bob Steagall

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Embracing (and also Destroying) Variant Types Safely – Andrei Alexandrescu – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
Designing and implementing a variant type (such as `std::variant` itself) in C++, at first, seems a rather inane topic. It turns out, however, that a variant type's performance or lack thereof, can have an inordinately large impact on software that directly impacts the bottom-line performance of important applications, such as interpreters. database clients, and communication protocols.

In this talk we will delve into the gory details of designing and implementing variant types, with an emphasis on layout, construction, and destruction. Along the way we'll figure out how to optimize not only the run time of the produced program, but also the time and memory consumed during compilation. These aspects, although seldom discussed, are important for provisioning and deploying continuous integration systems.

---
Andrei Alexandrescu

Andrei Alexandrescu is a researcher, software engineer, and author. He wrote three best-selling books on programming (Modern C++ Design, C++ Coding Standards, and The D Programming Language) and numerous articles and papers on wide-ranging topics from programming to language design to Machine Learning to Natural Language Processing. Andrei holds a PhD in Computer Science from the University of Washington and a BSc in Electrical Engineering from University "Politehnica" Bucharest. He is the Vice President of the D Language Foundation.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

YouTube Channel Managed by Digital Medium Ltd https://events.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

What Classes We Design and How – Peter Sommerlad – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---

C++ class design has been error prone since the beginning until Scott Meyers told us about the Rule-of-Three. But even that is not enforced by the language. In addition, C++11 changed the set of compiler-provided special member functions and the intrinsic rules have become more complicated. However, instead of starting from the rules for special member functions, we will look at what role a class type plays and how that maps on what special member functions to define and how, if any. Examples for class roles are Value, Relationship, Manager (scoped, unique, general), Mix-in.

We will also look at the roles of member variable types that influence or imply the role of the class type.
The role of a class will also take out many mysteries of move operations and will lead to clear guidance when and how to implement move: for suppressing copying, for managing unique ownership (Unique Manager) or for optimizing object copies (General Manager).

We will rehearse the Rule of Zero, and learn more about the Rule of Five/Six, the Rule of DesDeMovA, and the Rule of Unique Three.

This all will enable you to much more consciously and safely design your class types and combine types of member variables. You will have then the ability to select from a few reasonable combinations from the plethora of possibilities of special member function combinations: {public:,protected:,private:} x {destructor, default constructor, copy constructor, copy assignment, move constructor, assignment} x {noexcept(true),noexcept(false)} x { =default, =delete, {/*body*/}, not declared } (math as homework)

---
Peter Sommerlad

Peter Sommerlad was director of IFS Institute for Software at FHO/HSR Rapperswil, Switzerland. Peter is co-author of the books POSA Vol.1 and Security Patterns and contributed to "97 things every programmer should know". His goal is to make software simpler and safer by Decremental Development: Refactoring software down to 10% its size with better architecture, testability and quality and functionality. To reach that goal his team and students created the C++ IDE Cevelop. Peter is a member of MISRA-C++, Hillside, ACM, IEEE Computer Society, SI, ACCU, and the ISO C++ standardization committee.
---

Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology

Cool New Stuff in Gdb 9 and Gdb 10 – Greg Law – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---
GDB is bigger than you might think, and it's evolving fast. This is a depth-first walk through what's been added in versions 9 and 10. Depth-first meaning that no prior knowledge of these features is assumed, but even if you've used them before there should be plenty new for you. Few slides, lots of live demos. Some brand new things and some neat new additions to existing features. Topics include the new debuginfod facility; user-defined commands; enhancements to super-useful convenience variables such as $_siginfo, $_gdb_setting, $_gdb_setting_str; enhancements to TUI mode; how to add new TUI windows from GDB's Python scripting; advanced querying of types from GDB's Python scripting; and enhanced configuration of backtrace printing. You should learn at least two new tricks that will make improve you debugging effectiveness, and so make you a better programmer.

---
Greg Law

Greg is co-founder and CTO at Undo. He is a programmer at heart, but likes to keep one foot in the software world and one in the business world. Greg finds it particularly rewarding to turn innovative software technology into real business development. Greg has over 20 years of experience in both academia and innovative start-up software companies.

---
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com

Filed under: Science & Technology

Software Engineering Is About Tradeoffs – Mateusz Pusz – CppCon 2021

  • Lobby
  • Science & Technology

https://cppcon.org/
https://github.com/CppCon/CppCon2020
---

This talk presents a view of a Software Architect on designing interfaces. Often there is no such thing as "the best" solution for the problem. In many cases, we have to deal with compromises and accept the downsides of a specific approach. We often have to choose between exception safety guarantees, performance, dynamic allocations, and standardization or implementation effort.

During the talk, I will present some of the major trade offs and disagreements regarding the C++ design. I will also describe a few issues I encountered during the design of mp-units (the modern C++ physical units library) and ask the audience to make a choice between several alternative solutions to the problem.

---

Mateusz Pusz

A software architect, principal engineer, and security champion with more than 15 years of experience in designing, writing, and maintaining C++ code for fun and living. A trainer with 10 years of C++ teaching experience, consultant, conference speaker, and evangelist. His main areas of interest and expertise are Modern C++, code performance, low latency, safety, and maintainability.

Mateusz worked at Intel for 13 years, and now he is a Principal Software Engineer and the head of the C++ Competency Center at EPAM Systems. He is also a founder of Train IT that provides dedicated C++ trainings and consultant services to corporations around the world.

Mateusz is a contributor and an active voting member of the ISO C++ Committee (WG21) where, together with the best C++ experts in the world, he shapes the future of the C++ language. He is also a co-chair of WG21 Study Group 14 (SG14) responsible for driving performance and low latency subjects in the Committee. Recently also joined MISRA to help make self-driving cars safer.

---
Videos Streamed & Edited by Digital Medium: http://online.digital-medium.co.uk

The CppCon YouTube Channel Is Sponsored By:
JetBrains : http://jb.gg/cpptools
SonarSource: https://www.sonarsource.com/

Filed under: Science & Technology