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

json: configurable numeric decoding #137

Merged
merged 5 commits into from
Dec 4, 2023
Merged

Conversation

extemporalgenome
Copy link
Contributor

@extemporalgenome extemporalgenome commented Dec 1, 2023

This facilitates richer support for decoding JSON numbers into any. Whereas before, the only options were float64 and json.Number (essentially a string), Parse accepts UseInt64, UseUint64, and UseBigInt for in-range integer values (where UseBigInt supports arbitrary integers).

  • json: stylistic improvements, better code reuse
  • json: add ParseFlags values UseInt64, UseUint64, UseBigInt

Initial benchmark results show this change
to be approximately performance-neutral.
@extemporalgenome extemporalgenome force-pushed the json-big-int branch 6 times, most recently from 126373b to 8e09c7a Compare December 1, 2023 06:08
with:
name: ${{ matrix.ref }}
path: bench.txt
- name: Steup Go
Copy link

Choose a reason for hiding this comment

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

Is that a typo? Should it be "Setup"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Apparently it was already like that... I just changed the indentation. I'll fix

@extemporalgenome extemporalgenome merged commit 3055897 into master Dec 4, 2023
7 checks passed
@extemporalgenome extemporalgenome deleted the json-big-int branch December 4, 2023 22:00
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.

2 participants