Skip to content

Commit

Permalink
Comments
Browse files Browse the repository at this point in the history
  • Loading branch information
comphead committed Mar 20, 2024
1 parent e4a03d5 commit 67b54fb
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions docs/source/library-user-guide/profiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,7 @@
under the License.
-->

<!---
This file was generated by the dev/update_config_docs.sh script.
Do not edit it manually as changes will be overwritten.
Instead, edit dev/update_config_docs.sh or the docstrings in datafusion/core/src/config.rs.
-->

# Profiling
# Profiling Cookbook

The section contains examples how to perform CPU profiling for Apache Arrow DataFusion on different operating systems.

Expand All @@ -32,13 +26,20 @@ The section contains examples how to perform CPU profiling for Apache Arrow Data
### Building a flamegraph

- [cargo-flamegraph](https://github.com/flamegraph-rs/flamegraph)
Example:

Test:

```bash
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --root --unit-test datafusion -- dataframe::tests::test_array_agg
```

Benchmark:

```bash
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --root --unit-test datafusion -- dataframe::tests::test_xxx
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph --root --bench sql_planner -- --bench
```

Open SVG file with the browser
Open `flamegraph.svg` file with the browser

- dtrace with DataFusion CLI

Expand All @@ -51,9 +52,9 @@ sudo dtrace -c './target/debug/datafusion-cli -f test.sql' -o out.stacks -n 'pro
/tmp/fg/FlameGraph/stackcollapse.pl out.stacks | /tmp/fg/FlameGraph/flamegraph.pl > flamegraph.svg
```

Open SVG file with the browser
Open `flamegraph.svg` file with the browser

### CPU profiling
### CPU profiling with XCode Instruments

[Video: how to CPU profile DataFusion with XCode Instruments](https://youtu.be/P3dXH61Kr5U)

Expand Down

0 comments on commit 67b54fb

Please sign in to comment.