Skip to content

Commit f2ead7b

Browse files
committed
add v_jsonescape
1 parent 420f790 commit f2ead7b

File tree

3 files changed

+21
-36
lines changed

3 files changed

+21
-36
lines changed

Cargo.lock

Lines changed: 14 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ harness = false
1919
anyhow = "1"
2020

2121
[dev-dependencies]
22-
criterion = { version = "0.5", features = ["html_reports"] }
22+
criterion = { version = "0.7", features = ["html_reports"] }
2323
serde_json = "1"
24+
v_jsonescape = "0.7"
2425

2526
[profile.bench]
2627
lto = true

benches/escape.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ use string_escape_simd::{encode_str, encode_str_fallback};
77
const FIXTURE: &str = include_str!("../cal.com.tsx");
88

99
fn criterion_benchmark(c: &mut Criterion) {
10-
c.bench_function("escape simd", |b| b.iter(|| encode_str(black_box(FIXTURE))));
10+
c.bench_function("escape simd", |b| b.iter(|| black_box(encode_str(FIXTURE))));
11+
c.bench_function("escape v_jsonescape", |b| {
12+
b.iter(|| black_box(v_jsonescape::escape(FIXTURE)))
13+
});
1114
c.bench_function("escape software", |b| {
12-
b.iter(|| encode_str_fallback(black_box(FIXTURE)))
15+
b.iter(|| black_box(encode_str_fallback(FIXTURE)))
1316
});
1417
}
1518

0 commit comments

Comments
 (0)