Skip to main content
Synthesize trace events into a pprof-compliant profile that maps gas consumption to functions.

Usage

Description

The profile command converts Erst execution traces into the pprof profile format, which can be analyzed using Go’s profiling tools. This allows you to:
  • Map gas consumption to specific functions
  • Identify performance bottlenecks
  • Analyze call graphs and hotspots
  • Generate flamegraphs with standard tooling
The output is compatible with go tool pprof and other pprof-compatible analyzers.

Examples

Arguments

string
Path to the trace file to convert (JSON format)Can be provided as positional argument or via --file flag.

Flags

string
Trace file to load (alternative to positional argument)Alias: -f
string
default:"profile.pb.gz"
Output pprof file pathAlias: -o

Output format

The generated profile file is a gzip-compressed protobuf that contains:
  • Sample data: Gas consumption per function call
  • Call stacks: Complete execution paths
  • Location info: Function names and contract addresses
  • Metadata: Transaction hash, network, and timestamps

Analyzing profiles

Once you’ve generated a profile, use these commands to analyze it:

Interactive web UI

This launches a web interface with:
  • Interactive flamegraph
  • Call graph visualization
  • Source code view (if debug symbols available)
  • Top functions by gas consumption

Command-line analysis

Shows functions sorted by gas consumption.

Use cases

Optimize gas consumption

Identify which functions consume the most gas:

Compare optimizations

Generate profiles before and after optimization:

Debug performance issues

Find unexpected bottlenecks:
  • trace - View traces interactively
  • debug - Generate traces from transactions
  • compare - Compare gas usage between versions