GopherCon 2019: Two Go Programs, Three Different Profiling Techniques - Dave Cheney

Gopher Academy · 66K views · 2019 · 43:00

Open on YouTube

Software performance & optimizationC, C++, Rust, Go & systems languagestalk

Why Stack Overflow recommends it

Stack Overflow users link it when answering Go performance and concurrency questions, as a practical guide to pprof and execution traces, and when asking how the trace viewer opens its data.

Recommended by 3 people across 3 different months, 2019 to 2025.

What it is

A GopherCon 2019 tutorial in which Dave Cheney profiles two Go programs using three techniques: CPU profiling, memory profiling and execution tracing. It also covers reading the output of each tool and how Amdahl's Law limits what concurrency can gain.

What people said

Recommends ddevienne · 2019-09 · Stack Overflow · on “Load json manually in chrome://tracing”

this GopherCon video [this video] shows another solution I guess, which is to load into the browser an HTML page, probably with embedded Javascript in it, that “loads” the trace file. Although I suspect not from a disk file but by “serving” it directly via a custom http server.

Recommends Benny Jobigan · 2020-02 · Stack Overflow · on “Why can't I speed up my program by concurrently computing different parts of a slice?”

Assuming no obvious concurrency errors, you should use `pprof` to examine your program for bottlenecks and such. There are many good resources to learn about it. One of my favorite is Dave Cheney's presentation [this video]

Recommends coxley · 2024-02 · Stack Overflow · on “How many Goroutines is too many Goroutines?”

The answer is unsatisfying: It depends. You need to incorporate profiling into your development cycle to understand the best way forward — CPU and trace profiles work well for this. We can't easily predict your workload. And more importantly, if I had an infinite amount of Cores, there would be NO waiting in any thread/goroutine. If you're saying the work is entirely CPU-bound, having a number of goroutines equal to CPUs will likely perform best. Then your outer-logic sends work to each worker with a channel. Trace profiles will show how efficiently work is being scheduled for each CPU. CPU profiling could highlight where the hot-spots are. There's a talk by Dave Cheney where he shows three

Cites Crumml · 2025-07 · Stack Overflow · on “How to create a html file with a link that automatically opens chrome://tracing with a particular json file?”

I have a json file that contains profiling data that can be opened with chrome's trace-viewer. I can do it manually by opening chrome://tracing, then selecting 'load' and then loading the json file. Here in this video: [this video] they seem to have a html link which automatically opens such a trace in that trace viewer. How can I do that?