Skip to content

Easier flamegraph / profiling support for datafusion benchmarks #2174

@alamb

Description

@alamb

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
I want to make flamegraphs to understand performance of PRs like #2146 from @yjshen and other benchmarks in a cross platform, easy to use way. I don't want to switch between Instruments on Mac to perf on linux

It is not easy to get them (see this mailing list topic, and I hit the same "flamegraph takes forever to make" issue when I tried to run this on my development machine

Describe the solution you'd like
Use code in pprof crate -- @mkmik did this in influxdb_iox have used it to good effect in IOx

So this would look like adding an optional feature pprof to benchmark program that would generate flamegraphs and profile.proto format output. You would run it like this:

# --profile also writes flamegraph.svg and profile.proto files
target/release/tpch benchmark datafusion --profile --iterations 3 --path /tpch-parquet --format parquet --query 1

You could use the profile.proto in the (excellent) golang tooling like:

go tool pprof cpu.prof

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions