HackerTube

CppCon 2016: Nicholas Ormrod “The strange details of std::string at Facebook"

CppCon4 HN recommenders · recommended in 4 months, 2018–2026
YouTube
talk · advanced · evergreen · 2018–2026 on HN

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.

11 comments from Hacker News

@def-pri-pub2026-03 · 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%).

Recommends View on HN
@D4ckard2024-12 · 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.

Recommends View on HN
@jiggawatts2024-03 · 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

Recommends View on HN
@pjscott2020-01 · 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

Recommends View on HN
@sqrt_12025-05 · in “Writing into Uninitialized Buffers in Rust”

It was from C++con 2016 - Facebook take on small strings ▶ this video I believe it is about a page that was conditionally returned to the kernel.