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 2016: Nicholas Ormrod “The strange details of std::string at Facebook"

    CppCon

    4 HN recommenders · recommended in 10 months, 2018–2026

    YouTube

    31:19 · 122K views · Oct 5, 2016

    Nicholas Ormrod's CppCon 2016 talk on how Facebook optimizes std::string with its open-source replacement fbstring. It covers storage layout tradeoffs, small string optimization and memory allocation behavior.

    HN returns to it as the go-to talk on string internals, small string packing and why small percentage optimizations matter at scale.

    Software Engineering & LanguagesC, C++, Rust, Go & systems languagesSoftware performance & optimization
    1. 1:01:09
      Plenary: Performance Matters - Emery Berger - CppCon 2020CppCon33K views • 6 years ago
    2. 1:00:21
      CppCon 2019: Matt Godbolt “Compiler Explorer: Behind The Scenes”CppCon29K views • 7 years ago
    3. 1:12:27
      CppCon 2015: Andrei Alexandrescu “std::allocator...”CppCon196K views • 11 years ago
    4. 47:52
      Parsing JSON Really Quickly: Lessons LearnedInfoQ86K views • 6 years ago
    5. 1:29:55
      Sorting Algorithms: Speed Is Found In The Minds of People - Andrei Alexandrescu - CppCon 2019CppCon184K views • 7 years ago
    6. 1:00:17
      Stephan T. Lavavej “Floating-Point <charconv>: Making Your Code 10x Faster With C++17's Final Boss”CppCon41K views • 7 years ago
    7. 1:13:41
      CppCon 2014: Chandler Carruth "Efficiency with Algorithms, Performance with Data Structures"CppCon235K views • 12 years ago
    8. 1:27:46
      CppCon 2014: Mike Acton "Data-Oriented Design and C++"CppCon863K views • 12 years ago
    9. 59:34
      CppCon 2017: Matt Kulukundis “Designing a Fast, Efficient, Cache-friendly Hash Table, Step by Step”CppCon137K views • 9 years ago
    10. 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
    11. 1:54:00
      Can C++ be 10x Simpler & Safer? - Herb Sutter - CppCon 2022CppCon277K views • 3 years ago
    12. 1:04:00
      CppCon 2015: Sean Parent "Better Code: Data Structures"CppCon106K views • 11 years ago
    13. 55:49
      CppCon 2016: Chandler Carruth “High Performance Code 201: Hybrid Data Structures"CppCon119K views • 10 years ago
    14. 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
    15. 52:01
      CppCon 2017: Louis Brandy “Curiously Recurring C++ Bugs at Facebook”CppCon158K views • 9 years ago
    16. 1:30:53
      C++Now 2018: You Can Do Better than std::unordered_map: New Improvements to Hash Table PerformanceCppNow63K views • 8 years ago
    17. 1:39:25
      CppCon 2016: Herb Sutter “Leak-Freedom in C++... By Default.”CppCon149K views • 10 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. 36:10
      CppCon 2019: Emery Berger “Mesh: Automatically Compacting Your C++ Application's Memory”CppCon15K views • 7 years ago
    20. 1:24:36
      C++ Exceptions for Smaller Firmware - Khalil Estell - CppCon 2024CppCon23K views • 1 year ago

    11 comments from Hacker News

    1. @def-pri-pubMar 2026· in “Faster Asin() Was Hiding in Plain Sight”

      You'd be surprised how it actually is worth the effort, even just a 1% improvement. If you have the time, this is a great talk to listen to: this video For a little toy ray tracer, it is pretty measly. But for a larger corporation (with a professional project) a 4% speed improvement can mean MASSIVE cost savings. Some of these tiny improvements can also have a cascading effect. Imagining finding a +4%, a +2% somewhere else, +3% in neighboring code, and a bunch of +1%s here and there. Eventually you'll have built up something that is 15-20% faster. Down the road you'll come across those optimizations which can yield the big results too (e.g. the +25%).

      RecommendsView on HN
    2. @jiggawattsMar 2024· in “Algorithms for Modern Hardware”

      The FAANGS certainly have people doing this kind of work. For example, Andrei Alexandrescu has a bunch of keynote talks at CPPCon where he talks about 1-4% speed optimisations he makes to the std library at Facebook. [LINK] I also like the talk by Nicholas Ormrod “The strange details of std::string at Facebook": this video

      RecommendsView on HN
    3. @D4ckardDec 2024· in “Fixing C Strings”

      Yes, there are really cool packing techniques. See this talk for example: this video I don't include the null-terminator because I use this type in my own environment where I never use null-terminated strings so there is no need for it.

      RecommendsView on HN
    4. @pjscottJan 2020· in “Libc++'s Implementation of std::string”

      I think this is the talk you're referring to. If not, it's still definitely worth a watch: this video

      RecommendsView on HN
    5. @jiggawattsMar 2023· in “Analyzing multi-gigabyte JSON files locally”

      You're all massively underestimating the memory requirements of a parsed data structure, which is very entertaining to watch. There's this rule-of-thumb that most programmers are wrong about performance costs by at least a couple of orders of magnitude, and it's on full display here. In most languages, dynamically allocated variable-sized objects have a minimum overhead of two pointer-sized fields: a pointer and a length. On a 64-bit platform, that's 16 bytes before you actually start having any data. Next, depending on the allocator used, the requested data size is probably rounded up, either to the next power of 2, or there may be a minimum allocation size of 1 pointer. That's "safe" on machines that can't do misaligned (byte-granularity) referencing directly from memory. Last but not least, most heap-based allocators have some "bookkeeping" overheads. Similarly, interpreted languages also have their internal "object" metadata overheads. Typically this is 1 or 2 extra pointers (+8 or +16 bytes). Assuming 24-48 bytes for all variable-length values is actually a pretty safe bet! There are exceptions: Unusually, C skips the 'length' value for strings by using null-termination, so C strings are often just 16 bytes (8 for the pointer, and 8 for the allocated object on the heap, assuming some sort of small-object optimisation is going on). The approach in C++ is to use "small string optimisation" where the string values are inlined into the std::string structure itself. This work

      CitesView on HN