Skip to content

Commit 1339b96

Browse files
authored
refactor: runtime detect simd features (#29)
1 parent 4a7dad2 commit 1339b96

File tree

13 files changed

+986
-89
lines changed

13 files changed

+986
-89
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
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
@@ -24,7 +24,6 @@ name = "escape"
2424
harness = false
2525

2626
[dependencies]
27-
sonic-simd = "0.1"
2827

2928
[dev-dependencies]
3029
criterion2 = "3"
@@ -39,6 +38,8 @@ sonic-rs = "0.5"
3938
[profile.bench]
4039
lto = true
4140
codegen-units = 1
41+
debug = true
42+
strip = false
4243

4344
[profile.instruments]
4445
inherits = "release"

benches/escape.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ fn get_affine_sources() -> Vec<String> {
4141
}
4242

4343
fn run_benchmarks(c: &mut Criterion, sources: &[String], prefix: &str) {
44+
let first = &sources[0];
45+
assert_eq!(escape(first), sonic_rs::to_string(first).unwrap());
46+
assert_eq!(escape(first), serde_json::to_string(first).unwrap());
47+
4448
c.bench_function(&format!("{} escape simd", prefix), |b| {
4549
b.iter(|| {
4650
for source in sources {

0 commit comments

Comments
 (0)