Skip to content

Commit

Permalink
Update simd-json to 0.13.4
Browse files Browse the repository at this point in the history
  • Loading branch information
djkoloski committed Nov 1, 2023
1 parent 04e47dc commit aa567bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ serde = { version = "1.0.153", features = ["derive"], optional = true }
serde_bare = { version = "0.5.0", optional = true }
serde_cbor = { version = "0.11.2", optional = true }
serde_json = { version = "1.0.96", optional = true }
simd-json = { version = "0.9.2", optional = true }
simd-json-derive = { version = "0.9.2", optional = true }
simd-json = { version = "0.13.4", optional = true }
simd-json-derive = { version = "0.13.0", optional = true }
speedy = { version = "0.8.6", optional = true }
savefile = { version = "0.16", optional = true }
savefile-derive = { version = "0.16", optional = true }
Expand Down
8 changes: 3 additions & 5 deletions src/bench_simd_json.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use criterion::{black_box, BatchSize, Criterion};
use simd_json::AlignedBuf;
use simd_json::Buffers;
use simd_json_derive::{Deserialize, Serialize};

pub fn bench<T>(name: &'static str, c: &mut Criterion, data: &T)
Expand All @@ -21,8 +21,7 @@ where
});

let deserialize_buffer = data.json_vec().unwrap();
let mut input_buffer = AlignedBuf::with_capacity(BUFFER_LEN);
let mut string_buffer = serialize_buffer;
let mut buffers = Buffers::new(BUFFER_LEN);

group.bench_function("deserialize", |b| {
b.iter_batched_ref(
Expand All @@ -31,8 +30,7 @@ where
black_box(
T::from_slice_with_buffers(
deserialize_buffer.as_mut_slice(),
&mut input_buffer,
string_buffer.as_mut_slice(),
&mut buffers,
)
.unwrap(),
);
Expand Down

0 comments on commit aa567bf

Please sign in to comment.