Skip to content

Commit

Permalink
fix simd_json build
Browse files Browse the repository at this point in the history
  • Loading branch information
quininer committed Nov 1, 2023
1 parent c9bbc24 commit 4a4a850
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ bson = { version = "2.6.0", git = "https://github.com/djkoloski/bson-rust", bran
bytecheck = { version = "0.6.10", optional = true }
bytemuck = { version = "1.13.1", optional = true }
capnp = { version = "0.16.1", optional = true }
cbor4ii = { version = "0.3.1", features = [ "use_std", "serde1" ], optional = true }
cbor4ii = { version = "0.3.1", features = ["use_std", "serde1"], optional = true }
ciborium = { version = "0.2.0", optional = true }
criterion = "0.5"
dlhn = { version = "0.1.4", optional = true }
Expand Down
6 changes: 2 additions & 4 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 input_buffer = Buffers::new(BUFFER_LEN);

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

0 comments on commit 4a4a850

Please sign in to comment.