-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
avoid reparsing numbers when serializing #1074
Open
pjfanning
wants to merge
1
commit into
playframework:main
Choose a base branch
from
pjfanning:faster-number-serialization
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
avoid reparsing numbers when serializing #1074
pjfanning
wants to merge
1
commit into
playframework:main
from
pjfanning:faster-number-serialization
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pjfanning
force-pushed
the
faster-number-serialization
branch
from
September 5, 2024 03:22
61f53e8
to
995ddc0
Compare
pjfanning
force-pushed
the
faster-number-serialization
branch
from
September 5, 2024 03:53
995ddc0
to
c399caf
Compare
pjfanning
force-pushed
the
faster-number-serialization
branch
2 times, most recently
from
September 5, 2024 04:55
b46b958
to
d97f4dd
Compare
cchantep
requested changes
Sep 12, 2024
play-json/jvm/src/main/scala/play/api/libs/json/jackson/JacksonJson.scala
Outdated
Show resolved
Hide resolved
play-json/jvm/src/main/scala/play/api/libs/json/jackson/StringBasedNumericNode.scala
Outdated
Show resolved
Hide resolved
cchantep
reviewed
Sep 12, 2024
play-json/jvm/src/main/scala/play/api/libs/json/jackson/JacksonJson.scala
Outdated
Show resolved
Hide resolved
Unit test required |
@cchantep I think the existing tests do a good job of testing this code change. |
cchantep
reviewed
Sep 14, 2024
5 tasks
Update StringBasedNumericNode.scala rework Update JacksonJson.scala add containsEOrDot requested changes to containsEOrDot remove StringBasedNumericNode imports remove new function add test add int serialization test Update JsonSpec.scala Update JsonSpec.scala
pjfanning
force-pushed
the
faster-number-serialization
branch
from
September 15, 2024 14:49
ccdfc2e
to
41444b1
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Alternative to #1073
This change avoids creating NumericNodes and parsing strings to numbers which ultimately have to be turned back to strings to write them.
I've had to leave the BigIntegerNode usage in there. Removing it breaks some tests. I've debugged and it is down to how writeNumber(String) is implemented in jackson-databind TokenBuffer. We would need to change this class in jackson-databind to fix this (and that is not likely to happen as it will probably cause other issues). Basically, writeNumber(String) is assumed to be a non-integer in TokenBuffer.