Skip to content

Commit

Permalink
Test benchmarks and Improve benchmark README.md (#1627)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb authored Jan 1, 2025
1 parent fe36020 commit 3bad04e
Show file tree
Hide file tree
Showing 3 changed files with 522 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ jobs:
uses: ./.github/actions/setup-builder
- run: cargo clippy --all-targets --all-features -- -D warnings

benchmark-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust Toolchain
uses: ./.github/actions/setup-builder
- run: cd sqlparser_bench && cargo clippy --all-targets --all-features -- -D warnings

compile:
runs-on: ubuntu-latest
steps:
Expand Down
24 changes: 23 additions & 1 deletion sqlparser_bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,26 @@
under the License.
-->

Benchmarks for sqlparser. See [the main README](../README.md) for more information.
Benchmarks for sqlparser. See [the main README](../README.md) for more information.

Note: this is in a separate, non workspace crate to avoid adding a dependency
on `criterion` to the main crate (which complicates testing without std).

# Running Benchmarks

```shell
cargo bench --bench sqlparser_bench
```

# Profiling

Note you can generate a [flamegraph] using the following command:

```shell
cargo flamegraph --bench sqlparser_bench
```

[flamegraph]: https://crates.io/crates/flamegraph

Here is an example flamegraph:
![flamegraph](img/flamegraph.svg)
Loading

0 comments on commit 3bad04e

Please sign in to comment.