Skip to content

Commit c046554

Browse files
authored
Benchmarks: update simdjson to latest version + cleanup (#113)
1 parent 7fdd095 commit c046554

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

bench/simdjson-utf8/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ edition = "2018"
77
publish = false
88

99
[build-dependencies]
10-
bindgen = "0.54.0"
11-
cmake = "0.1.44"
10+
bindgen = "0.72.1"
11+
cmake = "0.1.54"

bench/simdjson-utf8/build.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn get_cpp_link_stdlib() -> Option<String> {
2323
}
2424

2525
fn main() {
26-
let version = "0.9.2";
26+
let version = "4.2.2";
2727
let download_url =
2828
"https://github.com/simdjson/simdjson/archive/refs/tags/v".to_owned() + version + ".tar.gz";
2929
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
@@ -54,7 +54,6 @@ fn main() {
5454
// .define("CMAKE_C_COMPILER", "clang")
5555
// .define("CMAKE_CXX_COMPILER", "gcc")
5656
// .define("CMAKE_C_COMPILER", "gcc")
57-
.uses_cxx11()
5857
.build();
5958
eprintln!("building done");
6059

@@ -67,14 +66,14 @@ fn main() {
6766

6867
eprintln!("bindings");
6968
let bindings = bindgen::Builder::default()
70-
.clang_args(&[
69+
.clang_args([
7170
"-xc++",
7271
"-std=c++17",
7372
&("-I".to_owned() + &simdjson_dir + "/include"),
7473
])
7574
.header(&(simdjson_dir.to_owned() + "/include/simdjson/implementation.h"))
76-
.whitelist_function("simdjson::validate_utf8")
77-
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
75+
.allowlist_function("simdjson::validate_utf8")
76+
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
7877
.generate()
7978
.expect("unable to generate bindings");
8079
eprintln!("bindings done");

bench/simdjson-utf8/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#![expect(non_camel_case_types)]
21
use std::os::raw::c_char;
2+
use std::os::raw::c_ulong;
33

44
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
55

66
#[inline(always)] // only works if simdjson ist compiled with LLVM and cross-language LTO is enabled
77
pub fn validate(bytes: &[u8]) -> bool {
8-
unsafe { simdjson_validate_utf8(bytes.as_ptr() as *const c_char, bytes.len() as size_t) }
8+
unsafe { simdjson_validate_utf8(bytes.as_ptr() as *const c_char, bytes.len() as c_ulong) }
99
}
1010

1111
#[cfg(test)]

0 commit comments

Comments
 (0)