chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

41
vendor/jsonpath-rust/benches/equal.rs vendored Normal file
View File

@@ -0,0 +1,41 @@
use criterion::{criterion_group, criterion_main, Criterion};
use jsonpath_rust::{JsonPath, JsonPathQuery};
use serde_json::json;
use std::str::FromStr;
struct SearchData {
json: serde_json::Value,
path: JsonPath,
}
const PATH: &str = "$.[?(@.author == 'abcd(Rees)')]";
fn equal_perf_test_with_reuse(cfg: &SearchData) {
let _v = cfg.path.find(&cfg.json);
}
fn equal_perf_test_without_reuse() {
let json = Box::new(json!({
"author":"abcd(Rees)",
}));
let _v = json.path(PATH).expect("the path is correct");
}
pub fn criterion_benchmark(c: &mut Criterion) {
let data = SearchData {
json: json!({
"author":"abcd(Rees)",
}),
path: JsonPath::from_str(PATH).unwrap(),
};
c.bench_function("equal bench with reuse", |b| {
b.iter(|| equal_perf_test_with_reuse(&data))
});
c.bench_function("equal bench without reuse", |b| {
b.iter(equal_perf_test_without_reuse)
});
}
criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);