Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batson #136

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Batson #136

wants to merge 14 commits into from

Conversation

samuelcolvin
Copy link
Member

Adding "batson" binary alternative to JSON code crate.

From the README:

Binary Alternative To (J)SON. Designed to be very fast to query.

Inspired by Postgres' JSONB type and Snowflake's VARIANT type.

For a relatively small JSON document (3KB), batson is 14 to 126x faster than Jiter, and 106 to 588x faster than Serde.

test medium_get_str_found_batson   ... bench:          51 ns/iter (+/- 1)
test medium_get_str_found_jiter    ... bench:         755 ns/iter (+/- 66)
test medium_get_str_found_serde    ... bench:       5,420 ns/iter (+/- 93)
test medium_get_str_missing_batson ... bench:           9 ns/iter (+/- 0)
test medium_get_str_missing_jiter  ... bench:       1,135 ns/iter (+/- 46)
test medium_get_str_missing_serde  ... bench:       5,292 ns/iter (+/- 324)

crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 83.04058% with 280 lines in your changes missing coverage. Please review.

Project coverage is 87.96%. Comparing base (82d7146) to head (9da84a2).

Files with missing lines Patch % Lines
crates/batson/src/object.rs 86.84% 31 Missing and 24 partials ⚠️
crates/batson/src/decoder.rs 62.75% 17 Missing and 37 partials ⚠️
crates/batson/src/array.rs 87.93% 10 Missing and 35 partials ⚠️
crates/batson/src/header.rs 77.77% 31 Missing and 13 partials ⚠️
crates/batson/src/errors.rs 0.00% 34 Missing ⚠️
crates/batson/src/get.rs 86.28% 12 Missing and 12 partials ⚠️
crates/batson/src/encoder.rs 90.84% 5 Missing and 9 partials ⚠️
crates/batson/src/lib.rs 84.61% 3 Missing and 3 partials ⚠️
crates/batson/src/json_writer.rs 94.66% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #136      +/-   ##
==========================================
- Coverage   90.94%   87.96%   -2.98%     
==========================================
  Files          12       21       +9     
  Lines        2042     3689    +1647     
  Branches     2042     3689    +1647     
==========================================
+ Hits         1857     3245    +1388     
- Misses        112      236     +124     
- Partials       73      208     +135     
Files with missing lines Coverage Δ
crates/jiter/src/lazy_index_map.rs 97.03% <100.00%> (+1.07%) ⬆️
crates/jiter/src/python.rs 97.43% <100.00%> (ø)
crates/jiter/src/value.rs 82.35% <100.00%> (+0.64%) ⬆️
crates/batson/src/json_writer.rs 94.66% <94.66%> (ø)
crates/batson/src/lib.rs 84.61% <84.61%> (ø)
crates/batson/src/encoder.rs 90.84% <90.84%> (ø)
crates/batson/src/get.rs 86.28% <86.28%> (ø)
crates/batson/src/errors.rs 0.00% <0.00%> (ø)
crates/batson/src/header.rs 77.77% <77.77%> (ø)
crates/batson/src/array.rs 87.93% <87.93%> (ø)
... and 2 more

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 82d7146...9da84a2. Read the comment docs.

Copy link

codspeed-hq bot commented Sep 12, 2024

CodSpeed Performance Report

Merging #136 will improve performances by 12.32%

Comparing batson (9da84a2) with main (82d7146)

Summary

⚡ 1 improvements
✅ 72 untouched benchmarks

Benchmarks breakdown

Benchmark main batson Change
x100_jiter_skip 1.3 µs 1.2 µs +12.32%

crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
crates/batson/README.md Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant