-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Enable Fast Double Parser in Jackson #7909
Conversation
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
Let's add to the CHANGELOG something like "Improved performance of parsing ..."? |
libs/x-content/src/main/java/org/opensearch/common/xcontent/json/JsonXContent.java
Outdated
Show resolved
Hide resolved
@dblock @mgodwan I was looking into this feature and there are few "dragons" here:
I think this is a good feature to offer but may be we should be careful with using it as default? |
@reta I ran a few benchmarks with nyc taxis where I saw the following differences in throughput without and with this change:
These runs use JDK17 and show good improvements. |
I have updated the parser configuration for CborXContent, SmileXContent, and YamlXContent as well. |
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Mohit Godwani <mgodwan@amazon.com>
@mgodwan conflicts :( |
Signed-off-by: Mohit Godwani <mgodwan@amazon.com>
Resolved the conflicts. |
@mgodwan - Can you please add testing notes for the non JSON formats? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dblock are we good with making it default for main
and 2.x
but have an opt-out option for 2.x users (system property)?
Gradle Check (Jenkins) Run Completed with:
|
Gradle Check (Jenkins) Run Completed with:
|
For 3.0 (main) looks good. For 2.x, does it actually change behavior, even on edge cases? I read the above but can't tell what the specific examples are when users would get different results. If those exist, I would say it's a no-go because it would break semver. It should be optional. |
Correct, we could address that at backport with system property |
Signed-off-by: Mohit Godwani <81609427+mgodwan@users.noreply.github.com>
Gradle Check (Jenkins) Run Completed with:
|
@dblock sign off? |
I merged it, however I am still unclear what the edge cases are. I would at least add a test that demonstrates the handling of the edge case (a test that would fail if we remove this code). |
@dblock there is a difficult one (at least it seems to me):
Which ones you are thinking about? Or something very different? |
For serialization, some cases which yield different output on jdk-17 and with jackson flag enabled are listed here. e.g.
I could not find any cases for JDK-20 since jdk-20 and jackson seem to be using the same algorithm for converting java double to string. |
|
…erty (#8467) * Enable Fast Double Parser in Jackson Signed-off-by: Mohit Godwani <mgodwan@amazon.com> * Update chaneglog Signed-off-by: Mohit Godwani <mgodwan@amazon.com> * Add fast double writer behind system property Signed-off-by: Mohit Godwani <mgodwan@amazon.com> * Extract system property out to a constant Signed-off-by: Mohit Godwani <mgodwan@amazon.com> --------- Signed-off-by: Mohit Godwani <mgodwan@amazon.com>
@mgodwan So you're saying that the two outcomes of this change are 1) improved performance, and 2) fixing a bug such as specifying 8.41E21 would produce 8.409999999999999E21? If so YOLO. |
* Enable Fast Double Parser in Jackson Signed-off-by: Mohit Godwani <mgodwan@amazon.com> * Use Fast Double Parser in jackson Signed-off-by: Mohit Godwani <mgodwan@amazon.com> --------- Signed-off-by: Mohit Godwani <mgodwan@amazon.com> Signed-off-by: Mohit Godwani <81609427+mgodwan@users.noreply.github.com>
* Enable Fast Double Parser in Jackson Signed-off-by: Mohit Godwani <mgodwan@amazon.com> * Use Fast Double Parser in jackson Signed-off-by: Mohit Godwani <mgodwan@amazon.com> --------- Signed-off-by: Mohit Godwani <mgodwan@amazon.com> Signed-off-by: Mohit Godwani <81609427+mgodwan@users.noreply.github.com> Signed-off-by: Shivansh Arora <hishiv@amazon.com>
Description
Enable Jackson Features
USE_FAST_DOUBLE_PARSER
andUSE_FAST_DOUBLE_WRITER
Related Issues
Resolves #7822
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Verified all the content types with
_doc
API:JSON Document:
YAML Document: