Don't count negative sign towards the integer digit limit - #260
Don't count negative sign towards the integer digit limit#260lolopinto wants to merge 7 commits into
Conversation
Negative JSON integers with exactly 4300 digits were rejected because the leading minus sign wasn't being counted towards the integer digit limit. This changes it so that we count the digits independent of the sign and adds tests. ``` jiter.from_json(b"-" + b"9" * 4300) ``` This now parses successfully.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Merging this PR will regress 1 benchmark
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
|
@codspeedbot fix this regression |
|
I pointed an agent at this and it made some changes and it thinks the rest is because we don't have an apples to apples comparison |
|
looks like this damaged performance. |
|
Looks like the regression is down to this:
The benchmark only contains positive integers, and testing with identical dependencies shows no meaningful performance regression from the PR itself. Can we redo a base? or pin to 0.4.6? |
|
@codspeedbot explain this regression |
Your diagnosis is right — I reproduced it locally. The reported regression is not caused by this PR; it comes from two differences between the base run and the head run. What I measuredI ran 1. Base (
The only non-trivial cost of the diff is on the skip path, which now does one extra comparison per integer chunk in 2. Same head commit, only num-bigint changed (0.4.6 → 0.4.8):
That is the same set of benchmarks, in the same order of magnitude, as the CodSpeed report (-18.06% / -12.54% / -12.37% / -9.86% / -7.45% / -5.23%). 3. A second, independent confounder: the two runs were not on the same hardware. The base run (main What to doNo need to pin I checked that Summary
Learnings updated. See what CodSpeed remembers about this repository. Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot. |
Negative JSON integers with exactly 4300 digits were rejected because the leading minus sign was incorrectly counted towards the integer digit limit.
This changes it so that we count the digits independent of the sign and adds tests.
This now parses successfully.