Repository navigation
test: Add benchmarks for JSONB reading, writing, array functions and JSONPath - #110
Conversation
…JSONPath - `read`, `write` and `array` cover decoding, `to_string`, comparison, comparable encoding, building and modifying JSONB, and the array set operations, on canada, citm_catalog, twitter and a small document. - `json_path` covers `parse_json_path` on simple paths, long `&&`/`||` chains, and a name that contains `&&`. - `benches/README.md` explains how to run one case and how to compare against a saved baseline. - Upgrade criterion to 0.8 and simd-json to 0.19.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
sundy-li
left a comment
There was a problem hiding this comment.
LGTM. Checked out the branch: fmt and clippy (--all-targets, both feature sets) are clean, cargo test --benches runs all 131 benchmarks successfully, and the existing parser bench still builds against simd-json 0.19. The Databend profile values in the README (opt-level = "s", codegen-units = 1, lto = "thin") match Databend's [profile.release].
Non-blocking: criterion 0.8.2 needs Rust 1.86 and simd-json 0.19 needs 1.88, both newer than rust-version = "1.85". Main is already above 1.85 through ordered-float 5.5.1 (1.90), proptest and goldenfile, so this PR doesn't change anything. A follow-up bump of rust-version would make it accurate.
Part 3 of 3 stacked PRs.
Changes
benches/read.rs: parsing JSON text into JSONB, and reading JSONB:from_slice,to_value,to_string,from_raw_jsonb,object_each,get_by_name,select_by_path,contains,partial_cmp,convert_to_comparable,strip_nulls.benches/write.rs: building and modifying JSONB:build_array,object_insert,array_insert,concat,delete_by_name,select_array_by_path($.**),to_owned_jsonb,Value::to_vec, and conversion from jaq.benches/array.rs:array_distinct,array_intersection,array_exceptandarray_overlap.benches/json_path.rs:parse_json_pathon simple paths, filters with 1 to 256&&/||operators, and a name that contains&&.read,writeandarrayrun on canada.json, citm_catalog.json, twitter.json and a small object.benches/common/mod.rsholds the documents and the paths and keys used to query them.benches/README.mdexplains how to run one bench or one case, and how to compare against a saved baseline.Tests
cargo test --benchesruns each of the 131 benchmarks once, with both feature sets. fmt and clippy (--all-targets -D warnings) pass with both feature sets.