CPU and heap profiling and flamegraph visualization tool using @platformatic/react-pprof
npm install @platformatic/flameš„ CPU and heap profiling and flamegraph visualization tool built on top of @platformatic/react-pprof.
- Dual Profiling: Captures both CPU and heap profiles concurrently for comprehensive performance insights
- Auto-Start Profiling: Profiling starts immediately when using flame run (default behavior)
- Automatic Flamegraph Generation: Interactive HTML flamegraphs are created automatically for both CPU and heap profiles on exit
- LLM-Friendly Markdown Analysis: Generates markdown reports with hotspot analysis, ideal for AI-assisted performance debugging
- Sourcemap Support: Automatically translates transpiled code locations back to original source files (TypeScript, bundled JavaScript, etc.)
- Clear File Path Display: Shows exact paths and browser URLs for generated files
- Manual Control: Optional manual mode with signal-based control using SIGUSR2
- Interactive Visualization: WebGL-based HTML flamegraphs with zoom, search, and filtering
- CLI Interface: Simple command-line tool for profiling and visualization
- Zero Config: Works out of the box with sensible defaults
``bash`
npm install -g @platformatic/flame
`bashStart profiling your application (profiling begins immediately)
flame run server.js
$3
`bash
Start profiling in manual mode (requires signals to start)
flame run --manual server.jsIn another terminal, toggle profiling on/off
kill -USR2 Or use the built-in toggle command
flame toggle
`$3
`bash
Generate HTML flamegraph and markdown from pprof file
flame generate cpu-profile-2024-01-01T12-00-00-000Z.pbSpecify custom output file
flame generate -o my-flamegraph.html profile.pb.gzUse detailed markdown format for comprehensive analysis
flame generate --md-format=detailed profile.pb
`CLI Usage
`bash
flame [options] Commands:
run