Skip to content

Commit

Permalink
chore: add benchmark (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen authored Jul 20, 2024
1 parent e917ecb commit e60bfed
Show file tree
Hide file tree
Showing 4 changed files with 481 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Benchmark

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize]
paths:
- '**/*.rs'
- 'Cargo.lock'
- '.github/workflows/benchmark.yml'
push:
branches:
- main
paths:
- '**/*.rs'
- 'Cargo.lock'
- '.github/workflows/benchmark.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
benchmark:
name: Benchmark
runs-on: ubuntu-latest
steps:
- uses: taiki-e/checkout-action@v1

- uses: Boshen/setup-rust@main
with:
cache-key: benchmark
save-cache: ${{ github.ref_name == 'main' }}
tools: cargo-codspeed

- name: Build benchmark
run: cargo codspeed build --features codspeed

- name: Run benchmark
uses: CodSpeedHQ/action@v2
timeout-minutes: 15
with:
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}
308 changes: 308 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,13 @@ license = "MIT"
readme = "README.md"
repository = "https://github.com/oxc-project/json-strip-comments"

[[bench]]
name = "strip"
harness = false

[dev-dependencies]
serde_json = "1.0.117"
criterion2 = { version = "0.11.0", default-features = false }

[features]
codspeed = ["criterion2/codspeed"]
Loading

0 comments on commit e60bfed

Please sign in to comment.