Skip to content
HomeVideos
AllLongsCategoriesPlaylists
BooksBlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K

    CppCon 2019: Chandler Carruth “There Are No Zero-cost Abstractions”

    CppCon

    7 HN recommenders · recommended in 16 months, 2020–2026

    YouTube

    59:53 · 147K views · Oct 7, 2019

    Chandler Carruth argues in a CppCon 2019 talk that C++ has no truly zero-cost abstractions. Using examples like unique_ptr, ABI constraints and compile-time costs, he shows that abstractions cost runtime, compile time or human effort.

    HN commenters cite it whenever zero-cost abstraction claims come up, especially for why unique_ptr is not free on some ABIs.

    Software Engineering & LanguagesC, C++, Rust, Go & systems languagesSoftware performance & optimization
    1. 1:13:41
      CppCon 2014: Chandler Carruth "Efficiency with Algorithms, Performance with Data Structures"CppCon235K views • 12 years ago
    2. 1:33:02
      2013 Keynote: Chandler Carruth: Optimizing the Emergent Structures of C++CppNow34K views • 13 years ago
    3. 1:29:54
      CppCon 2015: Chandler Carruth "Tuning C++: Benchmarks, and CPUs, and Compilers! Oh My!"CppCon188K views • 11 years ago
    4. 1:00:58
      CppCon 2017: Chandler Carruth “Going Nowhere Faster”CppCon113K views • 9 years ago
    5. 55:49
      CppCon 2016: Chandler Carruth “High Performance Code 201: Hybrid Data Structures"CppCon119K views • 10 years ago
    6. 1:19:52
      CppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”CppCon264K views • 10 years ago
    7. 1:27:46
      CppCon 2014: Mike Acton "Data-Oriented Design and C++"CppCon863K views • 12 years ago
    8. 57:39
      CppCon 2016: Chandler Carruth “Garbage In, Garbage Out: Arguing about Undefined Behavior..."CppCon94K views • 10 years ago
    9. 1:14:22
      CppCon 2017: Fedor Pikus “C++ atomics, from basic to advanced. What do they really do?”CppCon289K views • 9 years ago
    10. 1:35:12
      Modernizing Compiler Design for Carbon Toolchain - Chandler Carruth - CppNow 2023CppNow71K views • 3 years ago
    11. 1:39:25
      CppCon 2016: Herb Sutter “Leak-Freedom in C++... By Default.”CppCon149K views • 10 years ago
    12. 1:29:06
      CppCon 2015: Herb Sutter "Writing Good C++14... By Default"CppCon193K views • 11 years ago
    13. 1:15:46
      CppCon 2017: Matt Godbolt “What Has My Compiler Done for Me Lately? Unbolting the Compiler's Lid”CppCon178K views • 9 years ago
    14. 1:54:00
      Can C++ be 10x Simpler & Safer? - Herb Sutter - CppCon 2022CppCon277K views • 3 years ago
    15. 1:00:07
      CppCon 2017: Carl Cook “When a Microsecond Is an Eternity: High Performance Trading Systems in C++”CppCon358K views • 9 years ago
    16. 1:06:00
      CppCon 2017: Juan Pedro Bolivar Puente “Postmodern immutable data structures”CppCon31K views • 9 years ago
    17. 1:04:33
      CppCon 2014: Jeff Preshing "How Ubisoft Develops Games for Multicore - Before and After C++11"CppCon53K views • 12 years ago
    18. 1:04:26
      CppCon 2018: G. Nishanov “Nano-coroutines to the Rescue! (Using Coroutines TS, of Course)”CppCon40K views • 8 years ago
    19. 1:01:09
      Plenary: Performance Matters - Emery Berger - CppCon 2020CppCon33K views • 6 years ago
    20. 1:31:14
      CppCon 2017: Titus Winters “C++ as a "Live at Head" Language”CppCon53K views • 9 years ago

    20 comments from Hacker News

    1. @metalrainMar 2022· in “Tech talks don’t have to be boring”

      Yes, tech talks don't need to be boring and I agree on many points on the post. But also not just 12 slides, more like hundreds of slides. One example I have is Chandler Carruths talk in CppCon 2019 "There Are No Zero-cost Abstrations" this video Chandler presents his point clearly and goes deep enough into the subject.

      Strongly recommendsView on HN
    2. @tylerhouOct 2020· in “The AMD Radeon Graphics Driver Makes Up Roughly 10.5% of the Linux Kernel”

      The other time that you saw it was also probably me. It's from this talk, which is about how a large amount of generated protocol buffer code at Google led to a quadratic increase in compile times: this video . TL;DW: The reasoning is because if you use a distributed build system, then your compile time is gated by the file with the longest compile time (tail latency). The more files you have, the greater chance that one of them takes a long time. When you generate source files, you tend to produce more files than if you didn't. Most users don't use a distributed build system to compile the kernel, so on further thought, in that case compile times probably scale closer to linear with the number of translation units. But wasted cycles are still wasted cycles, and regardless of how exactly compile times scale, you should still consider the cost of longer compile times when you duplicate code. With regards to link time optimization: sophisticated analyses take superlinear complexity: [LINK] . Disclaimer: I work at Google.

      RecommendsView on HN
    3. @TwentyPostsJul 2023· in “Scope-based resource management for the Linux kernel”

      When it comes to the overhead issues of unique_ptr, I always think of this video here: this video At 26:50 he gets into how this relates to ABI, and how 'fixing' some of this would require a pretty severe ABI change, as well as destructive move semantics, which would require a severe change to how C++ works. I frankly don't understand C++ well enough to fully judge about all of this, but everything he says seems entirely solid, and showcases how unique_ptr is in fact not zero-cost, and can in fact be a significant performance trade-off when you really need that extra bit of performance. > Rust occasionally forces my hand considerably harder (e.g. RC<RefCell<..>> vs std::shared_ptr<>)) in the direction of performance compromise. How so? Is RC<RefCell<T>> more expensive than std::shared_ptr<T>?

      RecommendsView on HN
    4. @kccqzySep 2022· in “C++20, How Hard Could It Be”

      > std::unique_ptr<Foo> doesn't have any overhead over Foo* in code where semantics is the same Not true. And you just refuted yourself by being up the ABI question. You should watch Titus Winters' presentation on this topic where he compiles code using unique_ptr and raw pointers, compares the assembler produced, and explains why unique_ptr has non-zero overhead. The overhead is indeed coming from the ABI. Google has been wanting the next C++ to break ABI but they didn't get enough votes in the standard committee. this video

      RecommendsView on HN
    5. @mehrdadnSep 2020· in “The problem with C”

      With the caveat that I am NOT suggesting this justifies choosing C over C++, I just wanted to mention this talk about how "zero-cost abstraction" is an idealism, not necessarily a reality: this video That said, I tried to reproduce something similar, and it seems the issue only occurs in my example due to external linkage (adding 'static' fixes it)... but I can't claim this will always resolve the issue: [LINK]

      RecommendsView on HN