Hidden Overhead of a Function API - Oleksandr Bacherikov - CppCon 2024

Channel

https://cppcon.org
---

Hidden Overhead of a Function API - Oleksandr Bacherikov - CppCon 2024
---

API design and code performance are some of the most discussed topics in the C++ community. However, surprisingly little is said about the fundamental element of programming where they meet: the function signature. As a result, overhead that can be incurred inside every function body and at every call site is not commonly recognized. Non-inlined function calls are places where the ABI specification comes into play, and its effect on the generated assembly doesn’t always match expectations, even on the common platforms.

In this talk, we’ll bridge the gap and provide a comprehensive list of performance pitfalls to be aware of when designing a function signature, including a compiler’s view on the frequently debated questions:

- returning by value or by output parameter;
- passing parameters by value or by reference;
- using abstractions that are commonly considered to have zero runtime overhead, such as std::unique_ptr and std::span.
---

Slides: https://github.com/CppCon/CppCon2024/blob/main/Presentations/Hidden_Ove…

Sponsored by JetBrains: https://www.jetbrains.com/clion/
---

Oleksandr Bacherikov

Oleksandr Bacherikov is a Software Engineer at Snap Inc working on Computer Vision and Machine Learning magic for mobile devices. He has more than 15 years of experience in Competitive Programming and is interested in implementing algorithms in the most effective, concise, and generic way at the same time.
---

CppCon is the annual, week-long face-to-face gathering for the entire C++ community. The conference is organized by the C++ community for the community. You will enjoy inspirational talks and a friendly atmosphere designed to help attendees learn from each other, meet interesting people, and generally have a stimulating experience. Taking place this year in Aurora, Colorado, near the Denver airport, and including multiple diverse tracks, the conference will appeal to anyone from C++ novices to experts.
Annual CppCon Conference - https://www.cppcon.org
https://www.linkedin.com/company/cppcon
https://x.com/cppcon
https://www.facebook.com/CppConference
https://www.reddit.com/r/cppcon/
https://mastodon.social/@CppCon
---

Videos Filmed & Edited by Bash Films: http://www.BashFilms.com
YouTube Channel Managed by Digital Medium Ltd: https://events.digital-medium.co.uk
---

#cpp #cplusplus #cppcon #cppprogramming #cplusplusprogramming #api #softwaredevelopment #softwareengineering #coding #code #computerscience #technology #technews #programming #programmer