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

handle trailing period in partial float mode #156

Closed
wants to merge 3 commits into from

Conversation

davidhewitt
Copy link
Collaborator

Fixes #146

Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 97.80220% with 2 lines in your changes missing coverage. Please review.

Project coverage is 91.13%. Comparing base (0496e89) to head (1e8c066).

Files with missing lines Patch % Lines
crates/jiter/src/number_decoder.rs 95.91% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #156      +/-   ##
==========================================
+ Coverage   90.94%   91.13%   +0.19%     
==========================================
  Files          12       12              
  Lines        2042     2098      +56     
  Branches     2042     2098      +56     
==========================================
+ Hits         1857     1912      +55     
- Misses        112      113       +1     
  Partials       73       73              
Files with missing lines Coverage Δ
crates/jiter/src/jiter.rs 93.06% <100.00%> (+0.26%) ⬆️
crates/jiter/src/parse.rs 95.00% <100.00%> (+0.02%) ⬆️
crates/jiter/src/py_lossless_float.rs 92.72% <100.00%> (ø)
crates/jiter/src/python.rs 97.53% <100.00%> (+0.09%) ⬆️
crates/jiter/src/value.rs 81.71% <100.00%> (ø)
crates/jiter/src/number_decoder.rs 92.16% <95.91%> (+0.67%) ⬆️

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 0496e89...1e8c066. Read the comment docs.

Copy link

codspeed-hq bot commented Oct 30, 2024

CodSpeed Performance Report

Merging #156 will degrade performances by 10.1%

Comparing dh/trailing-float (1e8c066) with main (0496e89)

Summary

❌ 1 regressions
✅ 72 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main dh/trailing-float Change
python_parse_string_array_not_cached 36.7 µs 40.8 µs -10.1%

@davidhewitt
Copy link
Collaborator Author

This seems functionally ok, the slowdown looks like it's a loss of inlining due to the additional re-parse. Can probably rework to fix that.

Comment on lines +148 to +156
def test_partial_float():
json = b'{"a": 1.2, "b": 2.3, "c": 3.'
parsed = jiter.from_json(json, partial_mode=True)
assert parsed == {"a": 1.2, "b": 2.3, "c": 3.0}

# test that stopping at every points is ok
for i in range(1, len(json)):
parsed = jiter.from_json(json[:i], partial_mode=True)
assert isinstance(parsed, dict)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only material change in this file (rest is autoformatting, sorry).

@davidhewitt
Copy link
Collaborator Author

Closing as per #146 (comment) - think we'll go in a different direction.

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.

Coercion of incomplete floats (eg.1.)
1 participant