Get the latest tech news

Understanding the Go Runtime: Profiling


In the previous article we took apart the reflect package and found that its magic is mostly the compiler leaving very good notes — type descriptors frozen into read-only data at build time, and a package that knows how to walk them. The whole article was about reading metadata that was already sitting in memory before main even started. Today we shift the perspective. Profiling is the runtime catching your program in motion — sampling what it’s doing and where it’s spending its time, then accumulating that into something you can open with go tool pprof. The heart of every sample is a call stack, produced with the same unwinder we saw in the Stacktraces article . So profiling is really live moment-catching sitting on top of build-time stack-reading.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of profiling

profiling

Photo of runtime

runtime

Related news:

News photo

We put a Redis server inside our runtime

News photo

Compiler-Assisted Floating-Point Error Analysis and Profiling with FPChecker

News photo

AWS debuts Lambda MicroVMs with up to 8 hours runtime