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 17 commits into
base: main
Choose a base branch
from
Open

Batson #136

wants to merge 17 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 82.44804% with 304 lines in your changes missing coverage. Please review.

Project coverage is 87.58%. Comparing base (82d7146) to head (6513df5).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/batson/src/decoder.rs 61.53% 20 Missing and 45 partials ⚠️
crates/batson/src/object.rs 86.60% 33 Missing and 25 partials ⚠️
crates/batson/src/array.rs 87.40% 12 Missing and 36 partials ⚠️
crates/batson/src/header.rs 78.04% 32 Missing and 13 partials ⚠️
crates/batson/src/errors.rs 0.00% 34 Missing ⚠️
crates/batson/src/get.rs 84.69% 16 Missing and 14 partials ⚠️
crates/batson/src/encoder.rs 91.13% 5 Missing and 9 partials ⚠️
crates/batson/src/lib.rs 85.00% 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.58%   -3.36%     
==========================================
  Files          12       21       +9     
  Lines        2042     3770    +1728     
  Branches     2042     3770    +1728     
==========================================
+ Hits         1857     3302    +1445     
- Misses        112      248     +136     
- Partials       73      220     +147     
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 85.00% <85.00%> (ø)
crates/batson/src/encoder.rs 91.13% <91.13%> (ø)
crates/batson/src/get.rs 84.69% <84.69%> (ø)
crates/batson/src/errors.rs 0.00% <0.00%> (ø)
crates/batson/src/header.rs 78.04% <78.04%> (ø)
crates/batson/src/array.rs 87.40% <87.40%> (ø)
... 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...6513df5. Read the comment docs.

Copy link

codspeed-hq bot commented Sep 12, 2024

CodSpeed Performance Report

Merging #136 will improve performances by 11.69%

Comparing batson (6513df5) with main (ae5fc7d)

Summary

⚡ 1 improvements
✅ 72 untouched benchmarks

Benchmarks breakdown

Benchmark main batson Change
sentence_jiter_iter 7.8 µs 6.9 µs +11.69%

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