A Bazel build profiler with flamegraph visualization.
go install github.com/thesayyn/gangaji/cmd/gangaji@latestOr build from source:
go build -o gangaji ./cmd/gangaji/# Build with profiling
bazel build //... --profile=profile.json
# Test with profiling
bazel test //... --profile=profile.json
# Include target labels for better visibility
bazel build //... --profile=profile.json --experimental_profile_include_target_labelbazel build //... --starlark_cpu_profile=starlark.jsonbazel build //... --profile=profile.json --starlark_cpu_profile=starlark.jsonBuild profile only:
gangaji --profile=profile.json
gangaji --profile=profile.json.gz # compressedStarlark CPU profile only:
gangaji --starlark_cpu_profile=starlark.jsonBoth profiles combined:
gangaji --profile=profile.json --starlark_cpu_profile=starlark.jsonAdditional options:
gangaji --profile=profile.json --port=3000 # custom port
gangaji --profile=profile.json --open=false # don't auto-open browser- Interactive flamegraph visualization
- Dark/light theme support
- Search and filter actions
- Zoom and drill-down navigation
- Build optimization suggestions
- Statistics by category and mnemonic
See the example/ directory for a sample Bazel project to test with.
# Generate profiles
cd example
bazel build //... --profile=profile.json --starlark_cpu_profile=starlark.json
cd ..
# View build profile only
./gangaji --profile=example/profile.json
# View starlark profile only
./gangaji --starlark_cpu_profile=example/starlark.json
# View both profiles combined
./gangaji --profile=example/profile.json --starlark_cpu_profile=example/starlark.jsonMIT