Flame Graphs on pprof

Performance Engineering · 2019 · 1 min read

Integrated flame graph visualization into Google's pprof profiler, making it accessible to Go developers worldwide

Overview

Integration of d3-flame-graph into pprof, bringing interactive flame graph visualization to Go's built-in profiling tool

Problem

Go developers use pprof for profiling, but pprof's visualization options were limited and didn't include interactive flame graphs

Constraints

  • Must integrate with existing pprof web interface
  • Must work with Go profiling data format
  • Must maintain pprof's existing functionality

Approach

Contributed d3-flame-graph integration to pprof's web UI, mapping Go profiling data to hierarchical format

Key Decisions

Contribute to pprof rather than build separate tool

Reasoning:

Pprof is the standard Go profiling tool; integration gives immediate access to all Go developers

Tech Stack

  • Go
  • JavaScript
  • D3.js

Result & Impact

  • All Go developers using pprof web interface
    Users

Made flame graphs accessible to millions of Go developers through their standard tooling

Learnings

  • Integration with standard tools drives adoption
  • Contributing to open source projects multiplies impact
  • Go profiling data maps well to hierarchical format

Usage

After profiling a Go application:

go tool pprof -http=:8080 cpu.prof

Navigate to the “Flame Graph” view in the pprof web UI to see interactive flame graphs powered by d3-flame-graph.