Skip to content
0:00 / 0:00

#coz#stabilizer#profiling

"Performance Matters" by Emery Berger

Strange Loop Conference

88K subscribers • 106 videos on Hallway • Conference channel

YouTube
  • Recommended by 16 people: 12 on Hacker News, 1 on Lobsters, 2 in engineering communities and 1 curated list.
  • A classic. People kept recommending it from 2019 to 2024.
  • Presented by Emery Berger

Intermediate. Assumes working knowledge.

501K views7 years ago16 recommendations

Systems programmingTools and practicePerformance and optimizationCompilers and interpretersDebugging

Emery Berger explains how code layout and memory alignment affect performance measurements and introduces tools for statistically sound profiling.

Performance clearly matters to users. For example, the most common software update on the AppStore is "Bug fixes and performance enhancements." Now that Moore's Law has ended, programmers have to work hard to get high performance for their applications. But why is performance hard to deliver? I will first explain why current approaches to evaluating and optimizing performance don't work, especially on modern hardware and for modern applications. I then present two systems that address these challenges. Stabilizer is a tool that enables statistically sound performance evaluation, making it possible to understand the impact of optimizations and conclude things like the fact that the -O2 and -O3 optimization levels are indistinguishable from noise (sadly true). Since compiler optimizations have run out of steam, we need better profiling support, especially for modern concurrent, multi-threaded applications. Coz is a new "causal profiler" that lets programmers optimize for throughput or latency, and which pinpoints and accurately predicts the impact of optimizations. Coz's approach unlocks previously unknown optimization opportunities. Guided by Coz, we improved the performance of Memcached (9%), SQLite (25%), and accelerated six other applications by as much as 68%; in most cases, this involved modifying less than 10 lines of code and took under half an hour (without any prior understanding of the programs!). Coz now ships as part of standard Linux distros (apt install coz-profiler). Emery Berger University of Massachusetts Amherst @emeryberger Emery Berger is a Professor in the College of Information and Computer Sciences at the University of Massachusetts Amherst, the flagship campus of the UMass system. He graduated with a Ph.D. in Computer Science from the University of Texas at Austin in 2002. Professor Berger has been a Visiting Scientist at Microsoft Research (where he is currently on sabbatical), the University of Washington, and at the Universitat Politècnica de Catalunya (UPC) / Barcelona Supercomputing Center (BSC). Professor Berger's research spans programming languages, runtime systems, and operating systems, with a particular focus on systems that transparently improve reliability, security, and performance. He and his collaborators have created a number of influential software systems including Hoard, a fast and scalable memory manager that accelerates multithreaded applications (used by companies including British Telecom, Cisco, Crédit Suisse, Reuters, Royal Bank of Canada, SAP, and Tata, and on which the Mac OS X memory manager is based); DieHard, an error-avoiding memory manager that directly influenced the design of the Windows 7 Fault-Tolerant Heap; and DieHarder, a secure memory manager that was an inspiration for hardening changes made to the Windows 8 heap. His honors include a Microsoft Research Fellowship, an NSF CAREER Award, a Lilly Teaching Fellowship, the Distinguished Artifact Award for PLDI 2014, Most Influential

Why it's here

16 people recommend this

What people say. Highly recommended for understanding the impact of memory layout on benchmarking and how causal profiling can identify real optimization opportunities.

u/vitamin_CPPin r/C_Programming • Recommends

"Performance Matters" - Why current approaches to evaluating and optimizing performance don't work and how to fix it.

inactive-useron Lobsters • Recommends

Performance Matters

divanon Hacker News • Recommends

On “Ask HN: Best Talks of 2019?”

"Performance matters" by Emery Berger on StrangeLoop'19 is a great talk - link to this video Also, rest of his talks are also fascinating: - link - link

jaybosamiyaon Hacker News • Recommends

On “Measure code execution time accurately in Python”

I haven't had a chance to mess around with it much, but the coz-profiler 1 uses basically the same idea, but the other way around (i.e., slow down everything else to get a "virtual speedup") which helps quantify what the effect of optimizing some code would be. I learnt about this tool from Emery Berger's talk 2 on this (at strangeloop), which I highly recommend. Lots of really nice insight, even outside of this tool. 1 link 2 link to this video

robocaton Hacker News • Recommends

On “The naked truth about writing a programming language (2014)”

Aside: this is the most amazing optimisation information I have seen: link to this video Unfortunate that it is a video... Summary: Modern CPUs have so many hidden causes of performance variation, that you require special tools to actually measure small performance gains. He finds an amazing but unobvious speed up in SQLite using the causal analysis tool they developed. And a surprising difference between -O2 and -O3 implying overfitting.

acidbaseextracton Hacker News • Recommends

On “Ryzen 5800X vs. M1: Programming benchmarks”

I would highly recommend Emery Berger's talks 1 for anyone interested in benchmarking software. The alignment and code layout in memory that huayra mentions has shockingly large performance implications. 1 link to this video

j-pbon Hacker News • Recommends

On “Poop: Performance Optimizer Observation Platform”

…on this 1, and a causal profiler that they developed called Coz2. Branch miss-predicts might be somewhat invariant to that, but still, one of the main points of the talk is that people do too much eyeball statistics, mistaking the variance of the underlying stochastic process with actual signal. Coz is pretty trivial to set up with Zig too. 1. link to this video 2. link…

programming-talkscurated list on GitHubRecommends

Under “Performance Engineering”

Performance Matters 00:42:14 by **Emery Berger** (2019)

kristjanssonon Hacker News • Recommends

On “C performance mystery: delete unused string constant”

This1 talk from Emery Berger at last year's Strange Loop does a good job discussing the impact of alignment and other 'small' changes on performance, and how to estimate the actual impact of changes on performance 1: link to this video

Twirrimon Hacker News • Recommends

On “C performance mystery: delete unused string constant”

It's mentioned elsewhere in this HN discussion, but I think I'd encourage watching this talk: link to this video . It's particularly relevant to what you're seeing.

vanderZwanon Hacker News • Recommends

On “Prefix Trees in Action”

Try getting them to watch this talk by Emery Berger: link to this video And who knows, maybe they'd even be interested in using coz afterwards: link

glandiumon Hacker News • Recommends

On “Bubble sort slower with -O3 than -O2 with GCC”

Relevant talk by Emery Berger: Performance matters link to this video I'd recommend everyone interested in the subject to watch it.

abainbridgeon Hacker News • Recommends

On “Algorithms for Modern Hardware”

I think the profiling section could benefit from a section describing the sort of profiling noise described in this video: link to this video The noise source described is that changes to the code typically alter alignments of code and/or data and that is often the cause of the performance difference measured, not the change to the algorithm. The reason this is noise is because unrelated changes to the code might make it change again. IIRC, the speaker suggests improving compiler/profiler tools to randomise these alignments and benchmark many times.

deltasepsilonon Hacker News • Recommends

On “Ask HN: Looking for a Talk on Software Optimization”

Woah, I can't believe it, I've found the discussion that linked the thing I was looking for. 1 It's called Coz, the causal profiler 2. I've submitted this talk again, because I think it's super interesting. 1 link 2 link to this video

jcalabroon Hacker News • Recommends

On “Coz: Causal Profiling”

There's a great talk that explains how/why this works for those looking for more info. Also, Go UMass! link to this video

u/cxzukin r/ProgrammingLanguages • Recommends

"Performance Matters" by Emery Berger