Skip to content

Commit

Permalink
add cal.com.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jun 8, 2024
1 parent d04a95f commit 8073775
Show file tree
Hide file tree
Showing 4 changed files with 30,607 additions and 14 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@ on:
- 'Cargo.lock'
- 'rust-toolchain.toml'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}

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

- name: Setup rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v1
- uses: Boshen/setup-rust@main
with:
channel: stable
cache-target: release
bins: cargo-codspeed
save-cache: ${{ github.ref_name == 'main' }}
tools: cargo-codspeed

- name: Build Benchmark
run: cargo codspeed build --features codspeed
Expand Down
15 changes: 8 additions & 7 deletions benches/transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,14 @@ impl TheBencher for SwcBencher {
}

fn transformer_benchmark(c: &mut Criterion) {
let filename = "typescript.js";
let source = std::fs::read_to_string(filename).unwrap();

let mut g = c.benchmark_group(filename);
OxcBencher::bench(&mut g, &source);
SwcBencher::bench(&mut g, &source);
g.finish();
let filenames = ["typescript.js", "cal.com.tsx"];
for filename in filenames {
let source = std::fs::read_to_string(Path::new("files").join(filename)).unwrap();
let mut g = c.benchmark_group(filename);
OxcBencher::bench(&mut g, &source);
SwcBencher::bench(&mut g, &source);
g.finish();
}
}

criterion_group!(transformer, transformer_benchmark);
Expand Down
Loading

0 comments on commit 8073775

Please sign in to comment.