Test benchmarks and Improve benchmark README.md (#1627)

This commit is contained in:
Andrew Lamb 2025-01-01 15:47:59 -05:00 committed by GitHub
parent fe36020890
commit 3bad04e9e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 522 additions and 1 deletions

View file

@ -37,6 +37,14 @@ jobs:
uses: ./.github/actions/setup-builder uses: ./.github/actions/setup-builder
- run: cargo clippy --all-targets --all-features -- -D warnings - 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: compile:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View file

@ -17,4 +17,26 @@
under the License. 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)

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.5 MiB