hackertube.io

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

CppCon · talk · Watch on YouTube

What it is

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.

Why Hacker News recommends it

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

  • 7 people recommended it
  • 7 different months
  • 1 strong recommendations
  • first 2020, last 2026

What HN commenters said

  1. “Chandler presents his point clearly and goes deep enough into the subject.”

    Clear presentation that goes deep into the subject.

    metalrain, 2022-03 · Strong recommendation · in “Tech talks don’t have to be boring”

  2. “See for a nice expose on this.”

    Expose on why unique_ptr is not zero-cost.

    blux, 2020-02 · Recommendation · in “Move, simply”

  3. “I just wanted to mention this talk about how "zero-cost abstraction" is an idealism, not necessarily a reality”

    Talk on zero-cost abstraction as idealism, not reality.

    mehrdadn, 2020-09 · Recommendation · in “The problem with C”

  4. “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”

    Explains quadratic compile times from generated code at Google.

    tylerhou, 2020-10 · Recommendation · in “The AMD Radeon Graphics Driver Makes Up Roughly 10.5% of the Linux Kernel”

  5. “he makes a convincing point”

    Makes a convincing point that no abstraction is zero cost.

    CountHackulus, 2021-08 · Recommendation · in “When zero cost abstractions aren't zero cost”

  6. “You should watch Titus Winters' presentation on this topic”

    Compares assembly showing unique_ptr overhead from ABI.

    kccqzy, 2022-09 · Recommendation · in “C++20, How Hard Could It Be”

  7. “everything he says seems entirely solid”

    Explains unique_ptr overhead and ABI constraints.

    TwentyPosts, 2023-07 · Recommendation · in “Scope-based resource management for the Linux kernel”

Excerpts from Hacker News comments, linked to the originals. Summaries and labels were written by a language model from those comments.

Topics: c++, zero-cost abstractions, unique_ptr, abi, compilers, performance

Also recommended by the same people