Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 33 additions & 13 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,12 @@ defaults:
shell: bash

jobs:
benchmark:
name: Benchmark
runs-on: ubuntu-latest
build:
name: Prepare
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v5

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-linux-gnu

- uses: actions/setup-node@v5
with:
node-version: 22
Expand All @@ -38,18 +33,43 @@ jobs:
run: node download-fixtures.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Fixtures
uses: actions/upload-artifact@v4
with:
name: benchmark-fixtures
path: fixtures
- name: Upload rxjs
uses: actions/upload-artifact@v4
with:
name: benchmark-rxjs
path: node_modules/rxjs

run:
runs-on: codspeed-macro
needs: build
steps:
- uses: actions/checkout@v5
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@v2
with:
tool: cargo-codspeed

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

run: cargo codspeed build --bench escape --features codspeed
- name: Download fixtures
uses: actions/download-artifact@v5
with:
name: benchmark-fixtures
path: fixtures
- name: Download rxjs
uses: actions/download-artifact@v5
with:
name: benchmark-rxjs
path: node_modules/rxjs
- name: Run benchmark
uses: CodSpeedHQ/action@v4
timeout-minutes: 15
with:
run: cargo codspeed run
mode: instrumentation
run: cargo codspeed run escape
mode: walltime
token: ${{ secrets.CODSPEED_TOKEN }}
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.0.0](https://github.com/napi-rs/json-escape-simd/compare/json-escape-simd-v1.1.0...json-escape-simd-v2.0.0) - 2025-10-13

### Other

- fix codspeed
- remove useless deps ([#28](https://github.com/napi-rs/json-escape-simd/pull/28))
- update benchmark result
- borrow the sonic-rs string escape implementation ([#27](https://github.com/napi-rs/json-escape-simd/pull/27))
- *(deps)* update rust crate json-escape to 0.3.0 ([#24](https://github.com/napi-rs/json-escape-simd/pull/24))
- *(deps)* update rust crate json-escape to 0.2.0 ([#23](https://github.com/napi-rs/json-escape-simd/pull/23))
- omit other crates in codspeed ([#22](https://github.com/napi-rs/json-escape-simd/pull/22))
- add benchmark ([#20](https://github.com/napi-rs/json-escape-simd/pull/20))

## [1.1.0](https://github.com/napi-rs/json-escape-simd/compare/json-escape-simd-v1.0.4...json-escape-simd-v1.1.0) - 2025-09-23

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["cpu-features"]

[package]
name = "json-escape-simd"
version = "1.1.0"
version = "2.0.0"
edition = "2024"
rust-version = "1.89.0"
include = ["src/**/*.rs"]
Expand All @@ -22,6 +22,7 @@ codspeed = ["criterion2/codspeed"]
[[bench]]
name = "escape"
harness = false
path = "benches/escape.rs"

[dependencies]
sonic-simd = "0.1"
Expand Down
2 changes: 2 additions & 0 deletions benches/escape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ use std::{fs, hint::black_box};

use criterion::{Criterion, criterion_group, criterion_main};

#[cfg(not(feature = "codspeed"))]
use generic::escape_generic;
use json_escape_simd::escape;

#[cfg(not(feature = "codspeed"))]
mod generic;

fn get_rxjs_sources() -> Vec<String> {
Expand Down