Skip to content

[post] How to use pprof in Go #50

@at15

Description

@at15

Type

  • request post from @at15

Related

Description

Benchmark w/o profiling is not very useful, you need to know where is the bottleneck.
There are many pprof posts online. However, every time I need to use pprof I found most top ranked search result are not good enough and outdated.

This post plans to cover the following

  • get profile data
    • in test using -cpuprofile
    • using http handler w/ custom route
    • dump to specific place in application code
  • read profile data
    • what is cumulative
    • why the sample time is larger than actual execution time (hint: you got more than one core)
    • flamegraph (honestly I found the default svg more useful than flamegraph for simple use cases)
  • internal of profile format
    • the proto
    • analysis pprof data in your own code
  • pprof in other languages
    • pingcap has one in rust
    • not sure about cpp and java, google might have it?
  • compare with perf
  • efficient storage of pprof data
    • this is mainly for benchhub ... I want to find a low cost way for compressing and querying profile data

Update

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions