Skip to content

Commit c1f9b29

Browse files
committed
ci: add benchmark
1 parent 5076c7a commit c1f9b29

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/benchmark.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Benchmark
2+
3+
permissions: {}
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
13+
cancel-in-progress: true
14+
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
jobs:
20+
benchmark:
21+
name: Benchmark
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: taiki-e/checkout-action@v1
25+
26+
- uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.2
27+
with:
28+
cache-key: benchmark
29+
save-cache: ${{ github.ref_name == 'main' }}
30+
tools: cargo-codspeed
31+
32+
- name: Build benchmark
33+
run: cargo codspeed build --features codspeed
34+
35+
- name: Run benchmark
36+
uses: CodSpeedHQ/action@v4
37+
timeout-minutes: 15
38+
with:
39+
run: cargo codspeed run
40+
mode: instrumentation
41+
token: ${{ secrets.CODSPEED_TOKEN }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
![Crates.io Version](https://img.shields.io/crates/v/json-escape-simd)
44
![docs.rs](https://img.shields.io/docsrs/json-escape-simd)
5+
[![CodSpeed Badge](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/napi-rs/json-escape-simd)
56

67
Optimized SIMD routines for escaping JSON strings. This repository contains the `json-escape-simd` crate, comparison fixtures, and Criterion benches against commonly used alternatives.
78

0 commit comments

Comments
 (0)