Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ jobs:
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run tests disable arbitrary_precision
run: cargo test --no-default-features --features databend --verbose
10 changes: 5 additions & 5 deletions benches/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use std::io::Read;
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};

fn parse_jsonb(data: &[u8]) {
let _v: jsonb::Value = jsonb::parse_value(data).unwrap();
let _v: jsonb::OwnedJsonb = jsonb::parse_owned_jsonb(data).unwrap();
}

fn parse_serde_json(data: &[u8]) {
Expand Down Expand Up @@ -46,20 +46,20 @@ fn add_benchmark(c: &mut Criterion) {
let file = format!("{}", path.unwrap().path().display());
let bytes = read(&file);

c.bench_function(&format!("jsonb parse {}", file), |b| {
c.bench_function(&format!("jsonb parse {file}"), |b| {
b.iter(|| parse_jsonb(&bytes))
});

c.bench_function(&format!("serde_json parse {}", file), |b| {
c.bench_function(&format!("serde_json parse {file}"), |b| {
b.iter(|| parse_serde_json(&bytes))
});

c.bench_function(&format!("json_deserializer parse {}", file), |b| {
c.bench_function(&format!("json_deserializer parse {file}"), |b| {
b.iter(|| parse_json_deserializer(&bytes))
});

let bytes = bytes.clone();
c.bench_function(&format!("simd_json parse {}", file), move |b| {
c.bench_function(&format!("simd_json parse {file}"), move |b| {
b.iter_batched(
|| bytes.clone(),
|mut data| parse_simd_json(&mut data),
Expand Down
4 changes: 2 additions & 2 deletions benches/strip_nulls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ fn add_benchmark(c: &mut Criterion) {
let bytes = read(&file);
let json = from_slice(&bytes).unwrap().to_vec();

c.bench_function(&format!("strip_nulls_deser[{}]", file), |b| {
c.bench_function(&format!("strip_nulls_deser[{file}]"), |b| {
b.iter(|| strip_nulls_deser(&json));
});

c.bench_function(&format!("strip_nulls_fast[{}]", file), |b| {
c.bench_function(&format!("strip_nulls_fast[{file}]"), |b| {
b.iter(|| strip_nulls_fast(&json));
});
}
Expand Down
Loading