feat(java): add fory json serialization#3784
Open
chaokunyang wants to merge 7 commits into
Open
Conversation
Add the standalone fory-json module with field-based JSON codecs, generated object codecs, layout-specific readers/writers, TypeRef reads, JSON object/array support, benchmarks, and tests.\n\nLatest JDK21 single-thread Eishay gate after optimization:\n- JSON parse String: 95.2% of registered Fory binary parse\n- JSON parse UTF8: 93.7% of registered Fory binary parse\n- JSON write String: 92.2% of registered Fory binary write\n- JSON write UTF8: 90.7% of registered Fory binary write
ayush00git
approved these changes
Jun 24, 2026
This file contains hidden or 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
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.
Why?
Fory Java needs a first-class JSON serialization path that keeps Fory's field-based data model and TypeRef-aware type resolution while providing competitive parse and write throughput for String and UTF-8 inputs.
What does this PR do?
fory-jsonJava module and wires it into the Java build.ForyJson,ForyJsonBuilder,JSONObject,JSONArray,ForyJsonException, and@JsonIgnore.TypeRefroot reads.This is still in the early stage, more works will be submitted in follow-up prs.
Related issues
None.
Does this PR introduce any user-facing change?
This adds the new Java
fory-jsonmodule and public JSON APIs. It does not change the Fory binary or xlang wire protocol.Benchmark
Latest JDK21 single-thread Eishay gate after optimization, compared against same-run registered Fory binary lanes:
JMH Perf result: