You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by ch...@apache.org on 2026/09/25 03:55:08 UTC
(fory-site) branch main updated: docs: publish Apache Fory 1.7.5 (#512)
This is an automated email from the ASF dual-hosted git repository.
chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory-site.git
The following commit(s) were added to refs/heads/main by this push:
new 16ec38ff44e docs: publish Apache Fory 1.7.5 (#512)
16ec38ff44e is described below
commit 16ec38ff44ec13e0e920224cc64d7e9db0e0d060
Author: Shawn Yang <sh...@gmail.com>
AuthorDate: Fri Sep 25 11:55:03 2026 +0800
docs: publish Apache Fory 1.7.5 (#512)
Publish Apache Fory 1.7.5 on the website with English and Chinese
release blogs, updated download/signature details, and current
installation examples. Refresh the existing 1.7 documentation snapshots
from the voted `v1.7.5` source and synchronize the corresponding Chinese
guides, including JSON output options, Scala/Kotlin defaults, and Python
collections and buffers.
Validation: both locale production builds passed; 209 changed Markdown
files passed focused markdownlint; 22 local routes passed
release-content and anchor checks. All 61 changed English snapshot files
matched the release source before formatting, benchmark evidence was
copied unchanged, and the source signature was verified using ASF KEYS
in an isolated keyring.
---
blog/2026-09-25-fory_1_7_5_released.md | 86 +
docs/compiler/build-integration.md | 2 +-
docs/compiler/cli.md | 2 +-
docs/grpc/csharp.md | 4 +-
docs/grpc/dart.md | 2 +-
docs/grpc/rust.md | 2 +-
docs/json/getting-started.md | 6 +-
docs/json/kotlin.md | 4 +-
docs/json/scala.md | 2 +-
docs/object-serialization/cpp/index.md | 8 +-
docs/object-serialization/csharp/index.md | 2 +-
docs/object-serialization/dart/index.md | 2 +-
docs/object-serialization/java/index.md | 4 +-
docs/object-serialization/kotlin/index.md | 4 +-
.../rust/basic-serialization.md | 2 +-
docs/object-serialization/rust/index.md | 8 +-
docs/object-serialization/scala/index.md | 2 +-
docs/row-format/java.md | 4 +-
docs/start/cpp.md | 2 +-
docs/start/csharp.md | 2 +-
docs/start/dart.md | 2 +-
docs/start/go.md | 2 +-
docs/start/java.md | 6 +-
docs/start/javascript.md | 4 +-
docs/start/kotlin.md | 4 +-
docs/start/python.md | 2 +-
docs/start/rust.md | 2 +-
docs/start/scala.md | 2 +-
docs/start/swift.md | 2 +-
.../2026-09-25-fory_1_7_5_released.md | 79 +
.../json/byte-array-formats-results.json | 625 ++++++
.../current/benchmarks/json/byte-array-formats.md | 92 +
.../benchmarks/json/pretty-printing-results.json | 2023 ++++++++++++++++++++
.../current/benchmarks/json/pretty-printing.md | 82 +
.../current/benchmarks/json/scala/README.md | 26 +-
.../current/compiler/build-integration.md | 2 +-
.../current/compiler/cli.md | 2 +-
.../current/grpc/csharp.md | 4 +-
.../current/grpc/dart.md | 2 +-
.../current/grpc/rust.md | 2 +-
.../current/json/annotations.md | 156 +-
.../current/json/custom-codecs.md | 31 +-
.../current/json/getting-started.md | 22 +-
.../current/json/graalvm.md | 9 +-
.../current/json/kotlin.md | 186 +-
.../current/json/object-mapping.md | 116 +-
.../current/json/scala.md | 234 ++-
.../current/json/security.md | 2 +-
.../object-serialization/cpp/configuration.md | 11 +-
.../current/object-serialization/cpp/index.md | 8 +-
.../current/object-serialization/cpp/security.md | 3 +-
.../object-serialization/csharp/configuration.md | 11 +-
.../current/object-serialization/csharp/index.md | 4 +-
.../object-serialization/csharp/security.md | 3 +-
.../object-serialization/dart/configuration.md | 9 +-
.../current/object-serialization/dart/index.md | 4 +-
.../current/object-serialization/dart/security.md | 3 +-
.../object-serialization/go/configuration.md | 11 +-
.../current/object-serialization/go/security.md | 3 +-
.../object-serialization/java/configuration.md | 61 +-
.../current/object-serialization/java/index.md | 6 +-
.../current/object-serialization/java/security.md | 3 +-
.../javascript/configuration.md | 7 +-
.../object-serialization/javascript/security.md | 3 +-
.../current/object-serialization/kotlin/index.md | 4 +-
.../python/basic-serialization.md | 36 +
.../object-serialization/python/configuration.md | 7 +-
.../current/object-serialization/python/native.md | 62 +
.../object-serialization/python/out-of-band.md | 13 +-
.../object-serialization/python/security.md | 5 +-
.../rust/basic-serialization.md | 2 +-
.../object-serialization/rust/configuration.md | 13 +-
.../current/object-serialization/rust/index.md | 8 +-
.../current/object-serialization/rust/security.md | 3 +-
.../current/object-serialization/scala/index.md | 2 +-
.../object-serialization/swift/configuration.md | 7 +-
.../current/object-serialization/swift/security.md | 3 +-
.../current/row-format/java.md | 4 +-
.../specification/xlang_implementation_guide.md | 13 +-
.../current/specification/xlang_type_mapping.md | 3 +
.../current/start/cpp.md | 2 +-
.../current/start/csharp.md | 2 +-
.../current/start/dart.md | 2 +-
.../current/start/go.md | 2 +-
.../current/start/java.md | 6 +-
.../current/start/javascript.md | 4 +-
.../current/start/kotlin.md | 4 +-
.../current/start/python.md | 2 +-
.../current/start/rust.md | 2 +-
.../current/start/scala.md | 2 +-
.../current/start/swift.md | 2 +-
.../json/byte-array-formats-results.json | 625 ++++++
.../benchmarks/json/byte-array-formats.md | 92 +
.../benchmarks/json/pretty-printing-results.json | 2023 ++++++++++++++++++++
.../benchmarks/json/pretty-printing.md | 82 +
.../version-1.7.0/benchmarks/json/scala/README.md | 26 +-
.../version-1.7.0/compiler/build-integration.md | 2 +-
.../version-1.7.0/compiler/cli.md | 2 +-
.../version-1.7.0/grpc/csharp.md | 4 +-
.../version-1.7.0/grpc/dart.md | 2 +-
.../version-1.7.0/grpc/rust.md | 2 +-
.../version-1.7.0/json/annotations.md | 142 +-
.../version-1.7.0/json/custom-codecs.md | 31 +-
.../version-1.7.0/json/getting-started.md | 6 +-
.../version-1.7.0/json/graalvm.md | 9 +-
.../version-1.7.0/json/kotlin.md | 92 +-
.../version-1.7.0/json/object-mapping.md | 116 +-
.../version-1.7.0/json/scala.md | 196 +-
.../version-1.7.0/json/security.md | 2 +-
.../object-serialization/cpp/configuration.md | 11 +-
.../object-serialization/cpp/index.md | 8 +-
.../object-serialization/cpp/security.md | 3 +-
.../object-serialization/csharp/configuration.md | 11 +-
.../object-serialization/csharp/index.md | 2 +-
.../object-serialization/csharp/security.md | 3 +-
.../object-serialization/dart/configuration.md | 9 +-
.../object-serialization/dart/index.md | 2 +-
.../object-serialization/dart/security.md | 3 +-
.../object-serialization/go/configuration.md | 11 +-
.../object-serialization/go/security.md | 3 +-
.../object-serialization/java/configuration.md | 61 +-
.../object-serialization/java/index.md | 4 +-
.../object-serialization/java/security.md | 3 +-
.../javascript/configuration.md | 7 +-
.../object-serialization/javascript/security.md | 3 +-
.../object-serialization/kotlin/index.md | 4 +-
.../python/basic-serialization.md | 36 +
.../object-serialization/python/configuration.md | 7 +-
.../object-serialization/python/native.md | 62 +
.../object-serialization/python/out-of-band.md | 13 +-
.../object-serialization/python/security.md | 5 +-
.../rust/basic-serialization.md | 2 +-
.../object-serialization/rust/configuration.md | 13 +-
.../object-serialization/rust/index.md | 8 +-
.../object-serialization/rust/security.md | 3 +-
.../object-serialization/scala/index.md | 2 +-
.../object-serialization/swift/configuration.md | 7 +-
.../object-serialization/swift/security.md | 3 +-
.../version-1.7.0/row-format/java.md | 4 +-
.../specification/xlang_implementation_guide.md | 13 +-
.../specification/xlang_type_mapping.md | 3 +
.../version-1.7.0/start/cpp.md | 2 +-
.../version-1.7.0/start/csharp.md | 2 +-
.../version-1.7.0/start/dart.md | 2 +-
.../version-1.7.0/start/go.md | 2 +-
.../version-1.7.0/start/java.md | 6 +-
.../version-1.7.0/start/javascript.md | 4 +-
.../version-1.7.0/start/kotlin.md | 4 +-
.../version-1.7.0/start/python.md | 2 +-
.../version-1.7.0/start/rust.md | 2 +-
.../version-1.7.0/start/scala.md | 2 +-
.../version-1.7.0/start/swift.md | 2 +-
.../download/index.md | 12 +-
src/components/home/HomepageLanding.tsx | 24 +-
src/pages/download/index.md | 12 +-
.../json/byte-array-formats-results.json | 625 ++++++
.../benchmarks/json/byte-array-formats.md | 105 +
.../benchmarks/json/pretty-printing-results.json | 2023 ++++++++++++++++++++
.../benchmarks/json/pretty-printing.md | 89 +
.../version-1.7.0/benchmarks/json/scala/README.md | 2 +
.../version-1.7.0/compiler/build-integration.md | 2 +-
versioned_docs/version-1.7.0/compiler/cli.md | 2 +-
versioned_docs/version-1.7.0/grpc/csharp.md | 4 +-
versioned_docs/version-1.7.0/grpc/dart.md | 2 +-
versioned_docs/version-1.7.0/grpc/rust.md | 2 +-
versioned_docs/version-1.7.0/json/annotations.md | 155 +-
versioned_docs/version-1.7.0/json/custom-codecs.md | 36 +-
.../version-1.7.0/json/getting-started.md | 6 +-
versioned_docs/version-1.7.0/json/graalvm.md | 8 +-
versioned_docs/version-1.7.0/json/kotlin.md | 90 +-
.../version-1.7.0/json/object-mapping.md | 108 +-
versioned_docs/version-1.7.0/json/scala.md | 218 ++-
versioned_docs/version-1.7.0/json/security.md | 2 +-
.../object-serialization/cpp/configuration.md | 35 +-
.../object-serialization/cpp/index.md | 8 +-
.../object-serialization/cpp/security.md | 4 +-
.../object-serialization/csharp/configuration.md | 33 +-
.../object-serialization/csharp/index.md | 2 +-
.../object-serialization/csharp/security.md | 4 +-
.../object-serialization/dart/configuration.md | 11 +-
.../object-serialization/dart/index.md | 2 +-
.../object-serialization/dart/security.md | 4 +-
.../object-serialization/go/configuration.md | 33 +-
.../object-serialization/go/security.md | 4 +-
.../object-serialization/java/configuration.md | 9 +-
.../object-serialization/java/index.md | 4 +-
.../object-serialization/java/security.md | 3 +-
.../javascript/configuration.md | 9 +-
.../object-serialization/javascript/security.md | 4 +-
.../object-serialization/kotlin/index.md | 4 +-
.../python/basic-serialization.md | 44 +
.../object-serialization/python/configuration.md | 9 +-
.../object-serialization/python/native.md | 70 +
.../object-serialization/python/out-of-band.md | 13 +-
.../object-serialization/python/security.md | 5 +-
.../rust/basic-serialization.md | 2 +-
.../object-serialization/rust/configuration.md | 33 +-
.../object-serialization/rust/index.md | 8 +-
.../object-serialization/rust/security.md | 4 +-
.../object-serialization/scala/index.md | 2 +-
.../object-serialization/swift/configuration.md | 9 +-
.../object-serialization/swift/security.md | 4 +-
versioned_docs/version-1.7.0/row-format/java.md | 4 +-
.../specification/xlang_implementation_guide.md | 14 +-
.../specification/xlang_type_mapping.md | 5 +
versioned_docs/version-1.7.0/start/cpp.md | 2 +-
versioned_docs/version-1.7.0/start/csharp.md | 2 +-
versioned_docs/version-1.7.0/start/dart.md | 2 +-
versioned_docs/version-1.7.0/start/go.md | 2 +-
versioned_docs/version-1.7.0/start/java.md | 6 +-
versioned_docs/version-1.7.0/start/javascript.md | 4 +-
versioned_docs/version-1.7.0/start/kotlin.md | 4 +-
versioned_docs/version-1.7.0/start/python.md | 2 +-
versioned_docs/version-1.7.0/start/rust.md | 2 +-
versioned_docs/version-1.7.0/start/scala.md | 2 +-
versioned_docs/version-1.7.0/start/swift.md | 2 +-
216 files changed, 11284 insertions(+), 721 deletions(-)
diff --git a/blog/2026-09-25-fory_1_7_5_released.md b/blog/2026-09-25-fory_1_7_5_released.md
new file mode 100644
index 00000000000..b9a62fba92d
--- /dev/null
+++ b/blog/2026-09-25-fory_1_7_5_released.md
@@ -0,0 +1,86 @@
+---
+slug: fory_1_7_5_release
+title: Fory v1.7.5 Released
+description: "Fory 1.7.5 adds flexible JSON output options, improves Scala and Kotlin JSON support, and expands Python collection support."
+authors: [chaokunyang]
+tags: [fory, java, json, kotlin, scala, python]
+---
+
+Apache Fory 1.7.5 is now available. This release includes 15 pull requests from 4 contributors,
+with more control over JSON output, improved Scala and Kotlin JSON handling, and broader Python
+collection support. See [Getting Started](/docs/start/) for installation instructions.
+
+## Highlights
+
+- JSON output supports per-call pretty printing, non-ASCII escaping, configurable byte-array formats including Base16, and explicit default-value omission.
+- Scala and Kotlin JSON handling improves codec coverage and missing-field defaults, with additional GraalVM fixes for Java JSON accessors.
+- Python adds collection-subclass support and fixes named-tuple and temporal-array-buffer handling.
+
+## JSON Output Options
+
+Fory JSON is a Java JSON serialization framework with optional Kotlin and Scala modules.
+Applications can now choose pretty output for individual calls while reusing the same instance:
+
+```java
+import java.util.Collections;
+import org.apache.fory.json.ForyJson;
+
+ForyJson json = ForyJson.builder().build();
+String pretty = json.toPrettyJson(Collections.singletonMap("name", "Fory"));
+byte[] prettyBytes = json.toPrettyJsonBytes(Collections.singletonMap("name", "Fory"));
+String compact = json.toJson(Collections.singletonMap("name", "Fory"));
+```
+
+`escapeNonAscii(true)` writes non-ASCII string values and names as JSON Unicode escapes.
+The builder's `byteArrayFormat` selects Base64 strings, Base16 strings, or signed numeric arrays
+for ordinary byte arrays, including nested values. Property-level `JsonByteArray` annotations
+can override that default:
+
+```java
+import org.apache.fory.json.ForyJson;
+import org.apache.fory.json.annotation.JsonByteArray;
+
+ForyJson hexJson = ForyJson.builder()
+ .byteArrayFormat(JsonByteArray.Format.BASE16)
+ .build();
+String text = hexJson.toJson(new byte[] {1, -2, 3}); // "\"01fe03\""
+byte[] bytes = hexJson.fromJson(text, byte[].class);
+```
+
+Default-value omission is available through explicit `NON_DEFAULT` policies on a property or
+its class with `JsonProperty` or `JsonInclude`. Applications must authorize only defaults that
+are stable, safe to evaluate, and restored consistently when a field is missing. Global
+`NON_DEFAULT` is rejected. Scala `NON_EMPTY` also recognizes `None` and supported empty strict
+collections and maps.
+
+See [JSON object mapping](/docs/json/object-mapping/) for output options and
+[default omission](/docs/json/annotations#jsoninclude-and-default-omission) for supported models
+and configuration examples.
+
+## Scala and Kotlin JSON Support
+
+Scala gains broader support for generic case classes, `Unit`, enumeration type tokens, and
+explicit string codecs for sealed hierarchies of singleton cases. Scala and Kotlin also refine
+missing-field defaults: Scala uses declared constructor defaults or type defaults; Kotlin uses
+declared defaults first, then zero or `false` for non-null numeric and Boolean parameters, or
+null for nullable parameters. Other non-null Kotlin parameters remain required.
+
+See the [Scala](/docs/json/scala/) and [Kotlin](/docs/json/kotlin/) guides for precise type and
+null behavior. This release also fixes Java JSON accessor handling in GraalVM Native Image.
+
+## Python Collections and Buffers
+
+Xlang mode accepts `Mapping`, `Sequence`, and `Set` implementations, including mutable variants,
+and restores their values as built-in `dict`, `list`, and `set` objects. Python native mode
+preserves registered `list`, `dict`, and `set` subclasses together with their instance state.
+
+Native mode also fixes named-tuple reconstruction and supports out-of-band buffers for NumPy
+datetime and timedelta arrays and Pandas datetime columns and indexes. See
+[Python collection interfaces](/docs/object-serialization/python/basic-serialization#collection-interfaces),
+[native mode](/docs/object-serialization/python/native/), and
+[out-of-band serialization](/docs/object-serialization/python/out-of-band/) for examples.
+
+The complete release notes are available on
+[GitHub](https://github.com/apache/fory/releases/tag/v1.7.5).
+
+**Full Changelog**: [v1.7.4...v1.7.5](https://github.com/apache/fory/compare/v1.7.4...v1.7.5)
diff --git a/docs/compiler/build-integration.md b/docs/compiler/build-integration.md
index d8becffd278..40921cc01da 100644
--- a/docs/compiler/build-integration.md
+++ b/docs/compiler/build-integration.md
@@ -211,7 +211,7 @@ Add the Fory dependency to `pubspec.yaml`:
```yaml
dependencies:
- fory: ^1.7.4
+ fory: ^1.7.5
dev_dependencies:
build_runner: ^2.4.0
diff --git a/docs/compiler/cli.md b/docs/compiler/cli.md
index f444d7cbd3f..859ccae09d3 100644
--- a/docs/compiler/cli.md
+++ b/docs/compiler/cli.md
@@ -689,5 +689,5 @@ fory = "x.y.z"
```yaml
dependencies:
- fory: ^1.7.4
+ fory: ^1.7.5
```
diff --git a/docs/grpc/csharp.md b/docs/grpc/csharp.md
index 4b841523a60..867be016b58 100644
--- a/docs/grpc/csharp.md
+++ b/docs/grpc/csharp.md
@@ -39,7 +39,7 @@ Server project:
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.4" />
+ <PackageReference Include="Apache.Fory" Version="1.7.5" />
<PackageReference Include="Grpc.AspNetCore" Version="2.71.0" />
</ItemGroup>
```
@@ -48,7 +48,7 @@ Client project:
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.4" />
+ <PackageReference Include="Apache.Fory" Version="1.7.5" />
<PackageReference Include="Grpc.Core.Api" Version="2.71.0" />
<PackageReference Include="Grpc.Net.Client" Version="2.71.0" />
</ItemGroup>
diff --git a/docs/grpc/dart.md b/docs/grpc/dart.md
index af6c82ae419..4df35db87ba 100644
--- a/docs/grpc/dart.md
+++ b/docs/grpc/dart.md
@@ -38,7 +38,7 @@ application that compiles or runs generated service companions:
```yaml
dependencies:
- fory: ^1.7.4
+ fory: ^1.7.5
grpc: ^4.0.0
dev_dependencies:
diff --git a/docs/grpc/rust.md b/docs/grpc/rust.md
index 6558ca94943..3b3ad8343f0 100644
--- a/docs/grpc/rust.md
+++ b/docs/grpc/rust.md
@@ -37,7 +37,7 @@ to build streaming responses or request streams.
```toml
[dependencies]
-fory = "1.7.4"
+fory = "1.7.5"
bytes = "1"
tonic = { version = "0.14", features = ["transport"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
diff --git a/docs/json/getting-started.md b/docs/json/getting-started.md
index 18516d9d160..aea3e942ba6 100644
--- a/docs/json/getting-started.md
+++ b/docs/json/getting-started.md
@@ -43,7 +43,7 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-json</artifactId>
- <version>1.7.4</version>
+ <version>1.7.5</version>
</dependency>
```
@@ -57,7 +57,7 @@ repositories {
mavenCentral()
}
-implementation("org.apache.fory:fory-json:1.7.4")
+implementation("org.apache.fory:fory-json:1.7.5")
```
### Kotlin
@@ -66,7 +66,7 @@ Kotlin/JVM applications add the optional Kotlin JSON runtime and use its single
```kotlin title="build.gradle.kts"
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.4")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.5")
}
```
diff --git a/docs/json/kotlin.md b/docs/json/kotlin.md
index e52994fe01d..4dc61836e17 100644
--- a/docs/json/kotlin.md
+++ b/docs/json/kotlin.md
@@ -41,7 +41,7 @@ repositories {
}
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.4")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.5")
}
```
@@ -54,7 +54,7 @@ plugins {
}
dependencies {
- ksp("org.apache.fory:fory-json-kotlin-ksp:1.7.4")
+ ksp("org.apache.fory:fory-json-kotlin-ksp:1.7.5")
}
```
diff --git a/docs/json/scala.md b/docs/json/scala.md
index 4ef2d934c7c..2517843244e 100644
--- a/docs/json/scala.md
+++ b/docs/json/scala.md
@@ -25,7 +25,7 @@ module works on the ordinary JVM and GraalVM Native Image. Android is not suppor
## Setup
```sbt
-libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.4"
+libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.5"
```
`ForyJsonScala.builder()` installs the Scala module and returns the standard Fory JSON builder:
diff --git a/docs/object-serialization/cpp/index.md b/docs/object-serialization/cpp/index.md
index 66050e74a32..afe718ab0f2 100644
--- a/docs/object-serialization/cpp/index.md
+++ b/docs/object-serialization/cpp/index.md
@@ -62,7 +62,7 @@ include(FetchContent)
FetchContent_Declare(
fory
GIT_REPOSITORY https://github.com/apache/fory.git
- GIT_TAG v1.7.4
+ GIT_TAG v1.7.5
SOURCE_SUBDIR cpp
)
FetchContent_MakeAvailable(fory)
@@ -92,11 +92,11 @@ module(
bazel_dep(name = "rules_cc", version = "0.1.1")
-bazel_dep(name = "fory", version = "1.7.4")
+bazel_dep(name = "fory", version = "1.7.5")
git_override(
module_name = "fory",
remote = "https://github.com/apache/fory.git",
- commit = "v1.7.4", # Or use a specific commit hash for reproducibility
+ commit = "v1.7.5", # Or use a specific commit hash for reproducibility
)
```
@@ -128,7 +128,7 @@ bazel run //:my_app
For local development, you can use `local_path_override` instead:
```bazel
-bazel_dep(name = "fory", version = "1.7.4")
+bazel_dep(name = "fory", version = "1.7.5")
local_path_override(
module_name = "fory",
path = "/path/to/fory",
diff --git a/docs/object-serialization/csharp/index.md b/docs/object-serialization/csharp/index.md
index 603deff64d8..314bbfc042f 100644
--- a/docs/object-serialization/csharp/index.md
+++ b/docs/object-serialization/csharp/index.md
@@ -46,7 +46,7 @@ Reference the single `Apache.Fory` package. It includes the Fory library and the
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.4" />
+ <PackageReference Include="Apache.Fory" Version="1.7.5" />
</ItemGroup>
```
diff --git a/docs/object-serialization/dart/index.md b/docs/object-serialization/dart/index.md
index ca9d6cc2ef6..de88d951a5d 100644
--- a/docs/object-serialization/dart/index.md
+++ b/docs/object-serialization/dart/index.md
@@ -47,7 +47,7 @@ Add the dependency to your `pubspec.yaml`:
```yaml
dependencies:
- fory: ^1.7.4
+ fory: ^1.7.5
dev_dependencies:
build_runner: ^2.4.0
diff --git a/docs/object-serialization/java/index.md b/docs/object-serialization/java/index.md
index 69d11b0e08c..e09006216c4 100644
--- a/docs/object-serialization/java/index.md
+++ b/docs/object-serialization/java/index.md
@@ -63,7 +63,7 @@ or later.
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-core</artifactId>
- <version>1.7.4</version>
+ <version>1.7.5</version>
</dependency>
```
@@ -71,7 +71,7 @@ or later.
```kotlin
// Binary object serialization
-implementation("org.apache.fory:fory-core:1.7.4")
+implementation("org.apache.fory:fory-core:1.7.5")
```
#### JDK 25 and Later
diff --git a/docs/object-serialization/kotlin/index.md b/docs/object-serialization/kotlin/index.md
index a5ba5e61b47..f39fcd83a45 100644
--- a/docs/object-serialization/kotlin/index.md
+++ b/docs/object-serialization/kotlin/index.md
@@ -53,14 +53,14 @@ See [Java Features](../java/index.md#features) for complete feature list.
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-kotlin</artifactId>
- <version>1.7.4</version>
+ <version>1.7.5</version>
</dependency>
```
### Gradle
```kotlin
-implementation("org.apache.fory:fory-kotlin:1.7.4")
+implementation("org.apache.fory:fory-kotlin:1.7.5")
```
### JDK25+
diff --git a/docs/object-serialization/rust/basic-serialization.md b/docs/object-serialization/rust/basic-serialization.md
index b26fe0c1cb7..c5ecc0bd109 100644
--- a/docs/object-serialization/rust/basic-serialization.md
+++ b/docs/object-serialization/rust/basic-serialization.md
@@ -147,7 +147,7 @@ let later = timestamp.checked_add_duration(duration)?;
```toml
[dependencies]
-fory = { version = "1.7.4", features = ["chrono"] }
+fory = { version = "1.7.5", features = ["chrono"] }
```
### Custom Types
diff --git a/docs/object-serialization/rust/index.md b/docs/object-serialization/rust/index.md
index eaba9f73a52..9b1e313541a 100644
--- a/docs/object-serialization/rust/index.md
+++ b/docs/object-serialization/rust/index.md
@@ -37,9 +37,9 @@ The Rust implementation provides versatile and high-performance serialization wi
| Crate | Description | Version |
| --------------------------------------------------------------------------- | ----------------------------------------------------- | --------------------------------------------- |
-| [`fory`](https://github.com/apache/fory/blob/main/rust/fory) | User-facing API, public Fory types, and derive macros | [1.7.4](https://crates.io/crates/fory) |
-| [`fory-core`](https://github.com/apache/fory/blob/main/rust/fory-core/) | Lower-level core crate for advanced integrations | [1.7.4](https://crates.io/crates/fory-core) |
-| [`fory-derive`](https://github.com/apache/fory/blob/main/rust/fory-derive/) | Procedural macro crate for direct derive-macro use | [1.7.4](https://crates.io/crates/fory-derive) |
+| [`fory`](https://github.com/apache/fory/blob/main/rust/fory) | User-facing API, public Fory types, and derive macros | [1.7.5](https://crates.io/crates/fory) |
+| [`fory-core`](https://github.com/apache/fory/blob/main/rust/fory-core/) | Lower-level core crate for advanced integrations | [1.7.5](https://crates.io/crates/fory-core) |
+| [`fory-derive`](https://github.com/apache/fory/blob/main/rust/fory-derive/) | Procedural macro crate for direct derive-macro use | [1.7.5](https://crates.io/crates/fory-derive) |
Most applications should depend on `fory` only. It re-exports the derive
macros and the public Fory types needed by generated code. Use `fory-core`
@@ -52,7 +52,7 @@ Add Apache Fory™ to your `Cargo.toml`:
```toml
[dependencies]
-fory = "1.7.4"
+fory = "1.7.5"
```
### Basic Example
diff --git a/docs/object-serialization/scala/index.md b/docs/object-serialization/scala/index.md
index edc61814969..f051855bbb9 100644
--- a/docs/object-serialization/scala/index.md
+++ b/docs/object-serialization/scala/index.md
@@ -49,7 +49,7 @@ See [Java Features](../java/index.md#features) for complete feature list.
Add the dependency with sbt:
```sbt
-libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.4"
+libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.5"
```
### JDK25+
diff --git a/docs/row-format/java.md b/docs/row-format/java.md
index 846df1db7ef..0fe607c728e 100644
--- a/docs/row-format/java.md
+++ b/docs/row-format/java.md
@@ -43,14 +43,14 @@ For Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-format</artifactId>
- <version>1.7.4</version>
+ <version>1.7.5</version>
</dependency>
```
For Gradle:
```kotlin
-implementation("org.apache.fory:fory-format:1.7.4")
+implementation("org.apache.fory:fory-format:1.7.5")
```
## Basic Usage
diff --git a/docs/start/cpp.md b/docs/start/cpp.md
index 9efa5a1b97d..dbd1443855a 100644
--- a/docs/start/cpp.md
+++ b/docs/start/cpp.md
@@ -45,7 +45,7 @@ include(FetchContent)
FetchContent_Declare(
fory
GIT_REPOSITORY https://github.com/apache/fory.git
- GIT_TAG v1.7.4
+ GIT_TAG v1.7.5
SOURCE_SUBDIR cpp
)
FetchContent_MakeAvailable(fory)
diff --git a/docs/start/csharp.md b/docs/start/csharp.md
index 5562e6372a6..e3b0a5308bf 100644
--- a/docs/start/csharp.md
+++ b/docs/start/csharp.md
@@ -36,7 +36,7 @@ Create a console project and add the released package:
```bash
dotnet new console -n ForyExample
cd ForyExample
-dotnet add package Apache.Fory --version 1.7.4
+dotnet add package Apache.Fory --version 1.7.5
```
Replace `Program.cs` with:
diff --git a/docs/start/dart.md b/docs/start/dart.md
index d301e6d90d5..f67b3d3e476 100644
--- a/docs/start/dart.md
+++ b/docs/start/dart.md
@@ -36,7 +36,7 @@ Add Fory and the generator to `pubspec.yaml`:
```yaml
dependencies:
- fory: 1.7.4
+ fory: 1.7.5
dev_dependencies:
build_runner: ^2.4.0
diff --git a/docs/start/go.md b/docs/start/go.md
index 159215aec82..145ffbc4dc5 100644
--- a/docs/start/go.md
+++ b/docs/start/go.md
@@ -38,7 +38,7 @@ Create a module and install the released Fory module:
mkdir fory-example
cd fory-example
go mod init example.com/fory-example
-go get github.com/apache/fory/go/fory@v1.7.4
+go get github.com/apache/fory/go/fory@v1.7.5
```
If a Go proxy has not picked up a new submodule tag yet, retry later or use
diff --git a/docs/start/java.md b/docs/start/java.md
index 0f3561ad712..8f0a338fa6a 100644
--- a/docs/start/java.md
+++ b/docs/start/java.md
@@ -44,14 +44,14 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-core</artifactId>
- <version>1.7.4</version>
+ <version>1.7.5</version>
</dependency>
```
Gradle:
```kotlin
-implementation("org.apache.fory:fory-core:1.7.4")
+implementation("org.apache.fory:fory-core:1.7.5")
```
Run this complete xlang round trip:
@@ -97,7 +97,7 @@ Fory JSON maps Java objects to standard JSON text and UTF-8 bytes. Add
`fory-json` instead of `fory-core` when the application only needs JSON:
```kotlin
-implementation("org.apache.fory:fory-json:1.7.4")
+implementation("org.apache.fory:fory-json:1.7.5")
```
Add the import to `ForyExample.java`:
diff --git a/docs/start/javascript.md b/docs/start/javascript.md
index 61f35e43161..32a4cf5c48c 100644
--- a/docs/start/javascript.md
+++ b/docs/start/javascript.md
@@ -36,7 +36,7 @@ npm --version
Install the core package:
```bash
-npm install @apache-fory/core@1.7.4
+npm install @apache-fory/core@1.7.5
```
Define a schema and run an xlang round trip:
@@ -72,7 +72,7 @@ JavaScript uses xlang mode. Continue with
For the optional Node.js string fast path, install the matching package version:
```bash
-npm install @apache-fory/core@1.7.4 @apache-fory/hps@1.7.4
+npm install @apache-fory/core@1.7.5 @apache-fory/hps@1.7.5
```
## Other Capabilities
diff --git a/docs/start/kotlin.md b/docs/start/kotlin.md
index 7230f96810e..189d918e685 100644
--- a/docs/start/kotlin.md
+++ b/docs/start/kotlin.md
@@ -44,7 +44,7 @@ repositories {
}
dependencies {
- implementation("org.apache.fory:fory-kotlin:1.7.4")
+ implementation("org.apache.fory:fory-kotlin:1.7.5")
}
```
@@ -88,7 +88,7 @@ module when interoperating with ordinary JSON APIs, browsers, logs, or other JSO
```kotlin title="build.gradle.kts"
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.4")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.5")
}
```
diff --git a/docs/start/python.md b/docs/start/python.md
index 98edf7f3867..5b761149501 100644
--- a/docs/start/python.md
+++ b/docs/start/python.md
@@ -35,7 +35,7 @@ python -m pip --version
Install the released package:
```bash
-python -m pip install pyfory==1.7.4
+python -m pip install pyfory==1.7.5
```
Run an xlang round trip:
diff --git a/docs/start/rust.md b/docs/start/rust.md
index 0ff8cc25a0a..228f9996dbb 100644
--- a/docs/start/rust.md
+++ b/docs/start/rust.md
@@ -36,7 +36,7 @@ Add the public crate:
```toml title="Cargo.toml"
[dependencies]
-fory = "1.7.4"
+fory = "1.7.5"
```
```rust
diff --git a/docs/start/scala.md b/docs/start/scala.md
index 24404d1f196..7fa04e7da16 100644
--- a/docs/start/scala.md
+++ b/docs/start/scala.md
@@ -37,7 +37,7 @@ Add the Fory Scala library to `build.sbt`:
```sbt
ThisBuild / scalaVersion := "3.3.1"
-libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.4"
+libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.5"
```
Create `src/main/scala/ScalaExample.scala`:
diff --git a/docs/start/swift.md b/docs/start/swift.md
index ae515626c4a..122e2f89150 100644
--- a/docs/start/swift.md
+++ b/docs/start/swift.md
@@ -42,7 +42,7 @@ Add the released package and depend on its `Fory` library in the generated `Pack
```swift title="Package.swift"
dependencies: [
- .package(url: "https://github.com/apache/fory.git", exact: "1.7.4")
+ .package(url: "https://github.com/apache/fory.git", exact: "1.7.5")
],
targets: [
.executableTarget(
diff --git a/i18n/zh-CN/docusaurus-plugin-content-blog/2026-09-25-fory_1_7_5_released.md b/i18n/zh-CN/docusaurus-plugin-content-blog/2026-09-25-fory_1_7_5_released.md
new file mode 100644
index 00000000000..ed31eb14b1e
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-blog/2026-09-25-fory_1_7_5_released.md
@@ -0,0 +1,79 @@
+---
+slug: fory_1_7_5_release
+title: Fory v1.7.5 发布
+description: "Fory 1.7.5 新增灵活的 JSON 输出选项,完善 Scala 和 Kotlin JSON 支持,并扩展 Python 集合支持。"
+authors: [chaokunyang]
+tags: [fory, java, json, kotlin, scala, python]
+---
+
+Apache Fory 1.7.5 已发布。本次发布包含 4 位贡献者提交的 15 个 PR,
+为 JSON 输出提供更多控制选项,完善 Scala 和 Kotlin JSON 处理,并扩展 Python 集合支持。
+安装方式请参阅[快速开始](/zh-CN/docs/start/)。
+
+## 主要更新
+
+- JSON 输出支持按次调用选择格式化输出、非 ASCII 转义、包含 Base16 的可配置字节数组格式,以及显式启用的默认值省略。
+- Scala 和 Kotlin JSON 改进编解码器覆盖范围与字段缺失时的默认值处理,并修复 Java JSON 访问器的 GraalVM 兼容问题。
+- Python 新增集合子类支持,并修复具名元组和时间类型数组缓冲区的处理。
+
+## JSON 输出选项
+
+Fory JSON 是 Java JSON 序列化框架,并提供可选的 Kotlin 和 Scala 模块。
+应用现在可以复用同一个实例,按次调用选择格式化输出:
+
+```java
+import java.util.Collections;
+import org.apache.fory.json.ForyJson;
+
+ForyJson json = ForyJson.builder().build();
+String pretty = json.toPrettyJson(Collections.singletonMap("name", "Fory"));
+byte[] prettyBytes = json.toPrettyJsonBytes(Collections.singletonMap("name", "Fory"));
+String compact = json.toJson(Collections.singletonMap("name", "Fory"));
+```
+
+`escapeNonAscii(true)` 将非 ASCII 字符串值和名称写为 JSON Unicode 转义。
+builder 的 `byteArrayFormat` 为普通字节数组选择 Base64 字符串、Base16 字符串或有符号数字数组格式,
+并适用于嵌套值。属性级 `JsonByteArray` 注解可以覆盖该默认设置:
+
+```java
+import org.apache.fory.json.ForyJson;
+import org.apache.fory.json.annotation.JsonByteArray;
+
+ForyJson hexJson = ForyJson.builder()
+ .byteArrayFormat(JsonByteArray.Format.BASE16)
+ .build();
+String text = hexJson.toJson(new byte[] {1, -2, 3}); // "\"01fe03\""
+byte[] bytes = hexJson.fromJson(text, byte[].class);
+```
+
+通过属性上的 `JsonProperty` 或类上的 `JsonInclude` 显式启用 `NON_DEFAULT`,即可省略默认值。
+应用只能为稳定、可安全求值且字段缺失时能恢复一致值的默认值启用该策略。
+全局 `NON_DEFAULT` 会被拒绝。Scala 的 `NON_EMPTY` 也能识别 `None` 以及受支持的空严格求值集合和 Map。
+
+输出选项见 [JSON 对象映射](/zh-CN/docs/json/object-mapping/),
+支持的模型和配置示例见[默认值省略](/zh-CN/docs/json/annotations#jsoninclude-and-default-omission)。
+
+## Scala 和 Kotlin JSON 支持
+
+Scala 扩展了泛型 case class、`Unit`、枚举类型令牌的支持,并可为由单例分支组成的 sealed 类型层次
+显式选择字符串编解码器。Scala 和 Kotlin 也完善了字段缺失时的默认值处理:Scala 使用声明的构造函数
+默认值或类型默认值;Kotlin 优先使用声明的默认值,否则非空数值和 Boolean 参数使用零或 `false`,
+可空参数使用 null。其他非空 Kotlin 参数仍为必需参数。
+
+精确的类型和 null 行为见 [Scala](/zh-CN/docs/json/scala/) 和 [Kotlin](/zh-CN/docs/json/kotlin/)
+指南。本次发布还修复了 GraalVM Native Image 中 Java JSON 访问器的处理。
+
+## Python 集合与缓冲区
+
+Xlang 模式接受 `Mapping`、`Sequence` 和 `Set` 的实现及其可变变体,
+并将其值恢复为内置 `dict`、`list` 和 `set` 对象。Python 原生模式会保留已注册的
+`list`、`dict` 和 `set` 子类及其实例状态。
+
+原生模式还修复了具名元组重建,并支持 NumPy 日期时间、时间差数组,以及 Pandas 日期时间列和索引的
+带外缓冲区。示例见 [Python 集合接口](/zh-CN/docs/object-serialization/python/basic-serialization#collection-interfaces)、
+[原生模式](/zh-CN/docs/object-serialization/python/native/)和
+[带外序列化](/zh-CN/docs/object-serialization/python/out-of-band/)。
+
+完整发布说明见 [GitHub](https://github.com/apache/fory/releases/tag/v1.7.5)。
+
+**完整变更记录**:[v1.7.4...v1.7.5](https://github.com/apache/fory/compare/v1.7.4...v1.7.5)
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/byte-array-formats-results.json b/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/byte-array-formats-results.json
new file mode 100644
index 00000000000..ca2f84727dd
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/byte-array-formats-results.json
@@ -0,0 +1,625 @@
+{
+ "environment": {
+ "cpu": "Apple M4 Pro",
+ "logical_cpus": 12,
+ "os": "macOS 15.7.2 arm64",
+ "jdk": "OpenJDK 25.0.3",
+ "jmh": "1.37"
+ },
+ "source": {
+ "fory": "13739263ebf31af5fc962184aaccf2833f8ffc9a",
+ "fory_baseline": "e1d2f9d67800901392755b1133968d448ab076b8",
+ "jsoniter_scala_base": "84cb277f2c2a16b4018bc61fdeec3eed62252a1e",
+ "jsoniter_scala_adapters": "71b2ba16f1d5261e2be4e98d5dfe4be452d0e136",
+ "jsoniter_scala_version": "2.40.2-SNAPSHOT",
+ "benchmark_scala": "3.9.0",
+ "fory_scala": "3.3.8"
+ },
+ "settings": {
+ "threads": 1,
+ "forks_per_run": 1,
+ "warmup_iterations": 3,
+ "measurement_iterations": 5,
+ "iteration_seconds": 1,
+ "jvm_args": ["-Xms1g", "-Xmx1g", "-XX:+UseParallelGC"],
+ "profiler": "gc"
+ },
+ "results": [
+ {
+ "case": "ArrayOfBytesReading",
+ "size": 512,
+ "pairs": [
+ {
+ "pair": 1,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 718561.6343142863,
+ "iterations_ops_s": [
+ 720966.2774700475, 722148.059950197, 723968.2127171038,
+ 699675.4454108089, 726050.1760232744
+ ],
+ "allocation_bytes_op": 528.0081562652304,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 644154.4427726491,
+ "iterations_ops_s": [
+ 642739.6225877892, 656549.9366009792, 647274.0194844017,
+ 629323.8870815604, 644884.7481085152
+ ],
+ "allocation_bytes_op": 1128.0091134734967,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.1155114155874863
+ },
+ {
+ "pair": 2,
+ "order": ["fory", "jsoniter_scala"],
+ "fory": {
+ "throughput_ops_s": 712768.7484642493,
+ "iterations_ops_s": [
+ 715809.6255148505, 712322.2180004838, 719427.3859759014,
+ 706451.1582493099, 709833.3545807011
+ ],
+ "allocation_bytes_op": 528.0082231131366,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 646910.5376279108,
+ "iterations_ops_s": [
+ 653642.6650007655, 648076.5626362266, 639063.9666087512,
+ 648406.7871787745, 645362.7067150369
+ ],
+ "allocation_bytes_op": 1128.0090703040241,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.1018042016718836
+ },
+ {
+ "pair": 3,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 713855.8384418925,
+ "iterations_ops_s": [
+ 713930.6941047948, 699719.8311706063, 713989.776513808,
+ 721117.7876197997, 720521.1028004538
+ ],
+ "allocation_bytes_op": 528.0082200551103,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 648694.3313125791,
+ "iterations_ops_s": [
+ 640046.1536157951, 651947.475615739, 650393.8228952556,
+ 649302.6479094238, 651781.5565266822
+ ],
+ "allocation_bytes_op": 1128.0090437194845,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.100450249037115
+ }
+ ],
+ "median_fory_ops_s": 713855.8384418925,
+ "median_jsoniter_ops_s": 646910.5376279108,
+ "median_paired_ratio": 1.1018042016718836,
+ "minimum_paired_ratio": 1.100450249037115,
+ "maximum_paired_ratio": 1.1155114155874863,
+ "geometric_paired_ratio": 1.1059010882137206
+ },
+ {
+ "case": "ArrayOfBytesWriting",
+ "size": 512,
+ "pairs": [
+ {
+ "pair": 1,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 3350580.997475249,
+ "iterations_ops_s": [
+ 3354256.676965812, 3350235.8910908336, 3370583.284923328,
+ 3343149.3809342943, 3334679.7534619793
+ ],
+ "allocation_bytes_op": 1888.0017545395815,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 1534400.3964775414,
+ "iterations_ops_s": [
+ 1555002.3973013056, 1551437.3792732242, 1483784.9963905278,
+ 1539026.116856106, 1542751.092566543
+ ],
+ "allocation_bytes_op": 1888.003826423861,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 2.1836419002282828
+ },
+ {
+ "pair": 2,
+ "order": ["fory", "jsoniter_scala"],
+ "fory": {
+ "throughput_ops_s": 3355366.2425028966,
+ "iterations_ops_s": [
+ 3371208.1427841824, 3370052.5561299818, 3367852.548591301,
+ 3335320.999305273, 3332396.965703745
+ ],
+ "allocation_bytes_op": 1888.0017485208652,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 1539684.6759449516,
+ "iterations_ops_s": [
+ 1530588.7989645593, 1536345.1128779924, 1550446.53671775,
+ 1520990.2236222902, 1560052.7075421656
+ ],
+ "allocation_bytes_op": 1888.0038163834627,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 2.179255463748514
+ },
+ {
+ "pair": 3,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 3328563.302552803,
+ "iterations_ops_s": [
+ 3320520.682048541, 3331924.359155337, 3319451.2998794424,
+ 3332810.7688661655, 3338109.40281453
+ ],
+ "allocation_bytes_op": 1888.0017662799612,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 1540486.9964760381,
+ "iterations_ops_s": [
+ 1537960.3534940826, 1560478.5204790654, 1537766.2635790894,
+ 1527368.4693392226, 1538861.3754887313
+ ],
+ "allocation_bytes_op": 1888.0038109181107,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 2.1607214537786446
+ }
+ ],
+ "median_fory_ops_s": 3350580.997475249,
+ "median_jsoniter_ops_s": 1539684.6759449516,
+ "median_paired_ratio": 2.179255463748514,
+ "minimum_paired_ratio": 2.1607214537786446,
+ "maximum_paired_ratio": 2.1836419002282828,
+ "geometric_paired_ratio": 2.174516874590141
+ },
+ {
+ "case": "Base16Reading",
+ "size": 512,
+ "pairs": [
+ {
+ "pair": 1,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 3359808.747011424,
+ "iterations_ops_s": [
+ 3170890.4021431804, 2835783.848635741, 3599267.745232154,
+ 3600313.8419093373, 3592787.8971367073
+ ],
+ "allocation_bytes_op": 528.0017648087484,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 2914929.3631949537,
+ "iterations_ops_s": [
+ 2894217.0461341827, 2909705.468348089, 2928398.5845325943,
+ 2897313.7225826643, 2945011.9943772373
+ ],
+ "allocation_bytes_op": 528.0020149494615,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.1526209826672622
+ },
+ {
+ "pair": 2,
+ "order": ["fory", "jsoniter_scala"],
+ "fory": {
+ "throughput_ops_s": 3585325.1970511647,
+ "iterations_ops_s": [
+ 3606779.6047478, 3620212.096465545, 3585192.9164911993,
+ 3573313.8467803146, 3541127.5207709647
+ ],
+ "allocation_bytes_op": 528.0016362855811,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 2873552.418737786,
+ "iterations_ops_s": [
+ 2761830.775159276, 2916270.0082977437, 2909785.4844934223,
+ 2912280.347573207, 2867595.47816528
+ ],
+ "allocation_bytes_op": 528.0020441965414,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.2476978577707751
+ },
+ {
+ "pair": 3,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 3603439.30158346,
+ "iterations_ops_s": [
+ 3626219.544144616, 3602839.8185009575, 3602282.722974174,
+ 3598315.7871311214, 3587538.6351664294
+ ],
+ "allocation_bytes_op": 528.0016283749771,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 2949382.2375222584,
+ "iterations_ops_s": [
+ 2947324.1011699555, 2941788.9030553037, 2943400.2053664513,
+ 2947093.167103884, 2967304.8109156964
+ ],
+ "allocation_bytes_op": 528.001988912211,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.2217606981354399
+ }
+ ],
+ "median_fory_ops_s": 3585325.1970511647,
+ "median_jsoniter_ops_s": 2914929.3631949537,
+ "median_paired_ratio": 1.2217606981354399,
+ "minimum_paired_ratio": 1.1526209826672622,
+ "maximum_paired_ratio": 1.2476978577707751,
+ "geometric_paired_ratio": 1.2066853323390903
+ },
+ {
+ "case": "Base16Writing",
+ "size": 512,
+ "pairs": [
+ {
+ "pair": 1,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 9639285.749072284,
+ "iterations_ops_s": [
+ 9720176.667163966, 9484401.322246242, 9672723.887067826,
+ 9634169.371241517, 9684957.497641867
+ ],
+ "allocation_bytes_op": 1048.0006091523976,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 8472009.567249341,
+ "iterations_ops_s": [
+ 8479680.230866075, 8457165.337729625, 8507324.055039847,
+ 8446205.415500265, 8469672.797110893
+ ],
+ "allocation_bytes_op": 1048.0006932682013,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.137780319127039
+ },
+ {
+ "pair": 2,
+ "order": ["fory", "jsoniter_scala"],
+ "fory": {
+ "throughput_ops_s": 9790192.385472855,
+ "iterations_ops_s": [
+ 9729910.203410858, 9798489.073830001, 9801086.328943448,
+ 9821711.761606097, 9799764.559573878
+ ],
+ "allocation_bytes_op": 1048.0005986565332,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 8444372.230910677,
+ "iterations_ops_s": [
+ 8454419.247091914, 8498853.198057437, 8439041.593527095,
+ 8413092.78031926, 8416454.335557679
+ ],
+ "allocation_bytes_op": 1048.0006945067705,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.159374802266034
+ },
+ {
+ "pair": 3,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 9627140.75202604,
+ "iterations_ops_s": [
+ 9571136.694928922, 9670291.685970405, 9650637.061303275,
+ 9649359.818529114, 9594278.499398485
+ ],
+ "allocation_bytes_op": 1048.0006093169627,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 8299340.122327629,
+ "iterations_ops_s": [
+ 8304739.0318363365, 8098181.555887745, 8329959.2642635,
+ 8378818.139460061, 8385002.620190503
+ ],
+ "allocation_bytes_op": 1048.0007070897,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.1599886991167216
+ }
+ ],
+ "median_fory_ops_s": 9639285.749072284,
+ "median_jsoniter_ops_s": 8444372.230910677,
+ "median_paired_ratio": 1.159374802266034,
+ "minimum_paired_ratio": 1.137780319127039,
+ "maximum_paired_ratio": 1.1599886991167216,
+ "geometric_paired_ratio": 1.1523347999694993
+ }
+ ],
+ "numeric_read_development_pairs": [
+ {
+ "pair": 1,
+ "measurement_iterations": 3,
+ "baseline": {
+ "throughput_ops_s": 532673.8573387515,
+ "iterations_ops_s": [
+ 525513.9417793049, 542316.8084152596, 530190.8218216901
+ ],
+ "allocation_bytes_op": 1656.0110539563302,
+ "artifact_sha256": {
+ "fory_json": "0b175646200572bd67817e5ff6350ca9b41ecf8d9c5fedb46ef90677fe335014",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "fory": {
+ "throughput_ops_s": 688445.4281281951,
+ "iterations_ops_s": [
+ 661077.1182975627, 700984.16167637, 703275.0044106527
+ ],
+ "allocation_bytes_op": 528.0085360717871,
+ "artifact_sha256": {
+ "fory_json": "3dc8c8cce674855b39faca03156bf57048bb28d1503513cd5d5a85c6935ea696",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 633958.6015719158,
+ "iterations_ops_s": [
+ 617689.5090250478, 649548.5363109286, 634637.7593797712
+ ],
+ "allocation_bytes_op": 1128.0092592375615,
+ "artifact_sha256": {
+ "fory_json": "0b175646200572bd67817e5ff6350ca9b41ecf8d9c5fedb46ef90677fe335014",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ }
+ },
+ {
+ "pair": 2,
+ "measurement_iterations": 3,
+ "baseline": {
+ "throughput_ops_s": 540338.0918875013,
+ "iterations_ops_s": [
+ 536275.7264876695, 526926.7419483826, 557811.8072264518
+ ],
+ "allocation_bytes_op": 1656.0108723773349,
+ "artifact_sha256": {
+ "fory_json": "0b175646200572bd67817e5ff6350ca9b41ecf8d9c5fedb46ef90677fe335014",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "fory": {
+ "throughput_ops_s": 720624.0504748118,
+ "iterations_ops_s": [
+ 725308.188246871, 717928.044117385, 718635.9190601795
+ ],
+ "allocation_bytes_op": 528.0081332921432,
+ "artifact_sha256": {
+ "fory_json": "3dc8c8cce674855b39faca03156bf57048bb28d1503513cd5d5a85c6935ea696",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 637647.9827981751,
+ "iterations_ops_s": [
+ 633147.7919315896, 637860.5415264402, 641935.6149364957
+ ],
+ "allocation_bytes_op": 1128.0092273109979,
+ "artifact_sha256": {
+ "fory_json": "0b175646200572bd67817e5ff6350ca9b41ecf8d9c5fedb46ef90677fe335014",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ }
+ }
+ ],
+ "integer_read_control": [
+ {
+ "pair": 1,
+ "baseline": {
+ "throughput_ops_s": 491577.15519360424,
+ "iterations_ops_s": [
+ 493226.1424904787, 487426.7022866886, 491108.85466615774,
+ 489525.76150114706, 496598.3150235495
+ ],
+ "allocation_bytes_op": 4176.011942924268,
+ "artifact_sha256": {
+ "fory_json": "0b175646200572bd67817e5ff6350ca9b41ecf8d9c5fedb46ef90677fe335014",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "fory": {
+ "throughput_ops_s": 498496.5149580714,
+ "iterations_ops_s": [
+ 500744.575380113, 500638.4030852225, 493489.2902459867,
+ 498268.2111324434, 499342.09494659153
+ ],
+ "allocation_bytes_op": 4176.011777540917,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ }
+ },
+ {
+ "pair": 2,
+ "baseline": {
+ "throughput_ops_s": 487399.4866039612,
+ "iterations_ops_s": [
+ 492882.917488924, 491449.6032085084, 492271.10849723214,
+ 483111.02830760553, 477282.77551753627
+ ],
+ "allocation_bytes_op": 4176.012066509457,
+ "artifact_sha256": {
+ "fory_json": "0b175646200572bd67817e5ff6350ca9b41ecf8d9c5fedb46ef90677fe335014",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "fory": {
+ "throughput_ops_s": 492338.3696801558,
+ "iterations_ops_s": [
+ 482311.38343038387, 493766.54553907254, 493700.9130787423,
+ 495583.89678214624, 496329.1095704343
+ ],
+ "allocation_bytes_op": 4176.01193743859,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ }
+ }
+ ]
+}
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/byte-array-formats.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/byte-array-formats.md
new file mode 100644
index 00000000000..ac69cd0eac4
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/byte-array-formats.md
@@ -0,0 +1,92 @@
+# JVM JSON 字节数组格式测量
+
+本次对比使用未修改的 jsoniter-scala `ArrayOfBytesReading`、`ArrayOfBytesWriting`、
+`Base16Reading` 和 `Base16Writing` 工作负载,参数为 `size=512`,覆盖数字字节数组和 Base16 字符串。
+吞吐量越高越好。
+
+最终 12 组相邻配对对比的提升均超过 10%。数字数组读取的余量较小,最小提升为 10.05%。
+这些是本地稳态测量,不保证其他大小、数据分布、机器或 JVM 上的结果。
+
+## 结果
+
+| 工作负载 | jsoniter-scala 中位数,ops/s | Fory 中位数,ops/s | 配对提升中位数 | 配对范围 |
+| ---------------- | ---------------------------: | -----------------: | -------------: | -------------------: |
+| 数字字节数组读取 | 646,911 | 713,856 | +10.18% | +10.05% 至 +11.55% |
+| 数字字节数组写入 | 1,539,685 | 3,350,581 | +117.93% | +116.07% 至 +118.36% |
+| Base16 读取 | 2,914,929 | 3,585,325 | +22.18% | +15.26% 至 +24.77% |
+| Base16 写入 | 8,444,372 | 9,639,286 | +15.94% | +13.78% 至 +16.00% |
+
+每组配对比较五轮测量迭代的均值。提升列是配对比值的中位数,不是两个独立中位数之比。
+保留全部最终样本。较早、较短的数字数组读取对比分别测得 +8.59% 和 +13.01%,也保留在证据中,
+说明不能将最终的小幅余量推广到其他环境。
+
+Fory 数字数组读取每次操作分配约 528 B,jsoniter-scala 约 1,128 B。
+数字数组输出两者均约 1,888 B,Base16 输入约 528 B,Base16 输出约 1,048 B。
+两者均使用返回独立数组的 API,不使用预分配输出的基准测试。
+这些稳态分配数据不包含启动及保留的查找表内存;Fory 的 Base16 输出表在首次使用后占用 256 KiB。
+
+受影响的整数读取路径还与优化前的 Fory 版本做了两组相邻配对比较,变化为 +1.41% 和 +1.01%,
+处于通常视为噪声的范围;这些运行中未观察到回退。
+
+[迭代样本、分配量、配对结果及制品哈希](byte-array-formats-results.json)以 JSON 提供。
+
+## 工作负载与配置
+
+输入字节为基准测试原有的 `(1 to size).map(_.toByte).toArray` 序列。
+数字数组保留原有有符号十进制 JSON 表示,Base16 保留原有小写十六进制字符串。
+模型、输入、期望输出和 jsoniter-scala 实现均未修改,只启用了缺失的 Fory 适配器及其已有正确性规格。
+
+Fory 使用通过公共 builder 分别配置的实例:
+
+```java
+import org.apache.fory.json.ForyJson;
+import org.apache.fory.json.annotation.JsonByteArray;
+
+ForyJson arrays = ForyJson.builder().byteArrayFormat(JsonByteArray.Format.ARRAY).build();
+ForyJson hex = ForyJson.builder().byteArrayFormat(JsonByteArray.Format.BASE16).build();
+```
+
+读取适配器调用 `fromJson(jsonBytes, classOf[Array[Byte]])`,写入适配器调用 `toJsonBytes(obj)`。
+这些配置也适用于嵌套字节数组,不是基准测试专用编解码器。
+
+## 环境与版本
+
+- 日期:2026 年 9 月 21 日。
+- Apple M4 Pro,12 个逻辑 CPU,48 GiB RAM;macOS 15.7.2 arm64。
+- OpenJDK 25.0.3;JMH 1.37。
+- Fory:`13739263ebf31af5fc962184aaccf2833f8ffc9a`,版本 `1.8.0-SNAPSHOT`。
+- Fory 优化前基线:`e1d2f9d67800901392755b1133968d448ab076b8`。
+- jsoniter-scala:`2.40.2-SNAPSHOT`,检出版本 `71b2ba16f1d5261e2be4e98d5dfe4be452d0e136`;
+ Fory 适配器新增内容基于 `84cb277f2c2a16b4018bc61fdeec3eed62252a1e`。
+- 基准测试 Scala:3.9.0;Fory JSON Scala:3.3.8。
+- 每次运行一个线程和一个 fork;三轮 1 秒预热、五轮 1 秒测量;
+ `-Xms1g -Xmx1g -XX:+UseParallelGC`;JMH GC profiler。
+- 每个工作负载三组相邻配对,顺序为 jsoniter/Fory、Fory/jsoniter、jsoniter/Fory。
+ 所有运行串行进行,保留日常桌面后台活动。
+
+测量期间 runtime、core、Scala 和基准测试 jar 固定不变。
+基线/当前版本对照中只替换 Fory JSON runtime jar。
+
+## 复现
+
+构建基准测试 assembly 前,先安装 Fory core、JSON 和 JSON Scala 制品。
+使用本地发布的快照时启用 Maven Local:
+
+```bash
+sbt --java-home "$JAVA_HOME" \
+ 'set ThisBuild / resolvers += Resolver.mavenLocal' \
+ '++3.9.0!' 'jsoniter-scala-benchmarkJVM/assembly'
+```
+
+每个方法在独立进程中运行,并在配对之间交替库的执行顺序。两个方法使用同一固定 classpath:
+
+```bash
+java -cp "$FORY_JSON_JAR:$FORY_SCALA_JAR:$FORY_CORE_JAR:$BENCHMARK_JAR" \
+ org.openjdk.jmh.Main ".*\.${CASE}\.${METHOD}$" \
+ -t 1 -f 1 -wi 3 -i 5 -w 1s -r 1s -p size=512 \
+ -jvmArgs '-Xms1g -Xmx1g -XX:+UseParallelGC' -foe true -prof gc \
+ -rf json -rff "$RESULT_FILE"
+```
+
+`CASE` 为上述四个工作负载之一,`METHOD` 为 `fory` 或 `jsoniterScala`。
+这里没有测量 GraalVM 或原生镜像性能。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/pretty-printing-results.json b/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/pretty-printing-results.json
new file mode 100644
index 00000000000..a09d6652547
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/pretty-printing-results.json
@@ -0,0 +1,2023 @@
+{
+ "date": "2026-09-21",
+ "foryCommit": "2b8af43f17c98633538594ab6ff942591728c0a4",
+ "foryBaseCommit": "509a096aa3ac68c0ca9ee248d085db7855523584",
+ "jsoniterBenchmarkCommit": "84cb277f2c2a16b4018bc61fdeec3eed62252a1e",
+ "environment": {
+ "os": "macOS 15.7.2 arm64",
+ "cpu": "Apple M4 Pro, 12 cores",
+ "memory": "48 GiB",
+ "jdk": "OpenJDK 25.0.3",
+ "jmh": "1.37",
+ "forksPerRun": 1,
+ "threads": 1,
+ "warmup": "3 x 1 s",
+ "measurement": "5 x 1 s",
+ "jvmArgs": "-Xms1g -Xmx1g -XX:+UseParallelGC",
+ "profiler": "gc",
+ "scalaBenchmark": "3.9.0",
+ "foryScala": "3.3.8",
+ "jsoniterScala": "2.40.2-SNAPSHOT"
+ },
+ "excludedPairs": [],
+ "artifactsSha256": {
+ "baseline-json.jar": "2cc53b28789886cd90be42d5c8a0caf2e16194a8b3a0c66754d73189e814932b",
+ "final-json.jar": "f1399c6a49e058be3a41928ca4960df968cda6626aa612fb9e218926533923d0",
+ "core.jar": "0dab0425a62469728075f0d49266c3ba636fdc8395ac2fe16cea0a54a6a40b7d",
+ "media-benchmarks.jar": "c164be3939b43782dbd5ee53ecbd4b9eca24c54f0e7e6671c396403c6ac3651c",
+ "write-scala.jar": "0398701d14d2068ccfbae6bd5a25c12f0e3acabfeee969260bea9d5bf0ae70f2",
+ "write-pretty-benchmarks.jar": "b6783c0f0d9ee9438e9ee073b558b92ddd66ad59f9b4c43ac9bfba77ca1b700c"
+ },
+ "results": [
+ {
+ "case": "MediaContent compact String",
+ "pairs": [
+ {
+ "pair": 1,
+ "baseline": 7740542.2410122575,
+ "current": 8586305.864112541,
+ "changePercent": 10.926413121539657,
+ "bytesPerOp": {
+ "baseline": 528.0007576294123,
+ "current": 528.0006836341037
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-string-1-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 7740542.2410122575,
+ "scoreError": 96749.01386114674,
+ "scoreConfidence": [
+ 7643793.227151111,
+ 7837291.254873404
+ ],
+ "scorePercentiles": {
+ "0.0": 7696272.997603743,
+ "50.0": 7747804.599157845,
+ "90.0": 7756392.0909042545,
+ "95.0": 7756392.0909042545,
+ "99.0": 7756392.0909042545,
+ "99.9": 7756392.0909042545,
+ "99.99": 7756392.0909042545,
+ "99.999": 7756392.0909042545,
+ "99.9999": 7756392.0909042545,
+ "100.0": 7756392.0909042545
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 7756392.0909042545,
+ 7746784.304379124,
+ 7755457.213016323,
+ 7747804.599157845,
+ 7696272.997603743
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007576294123,
+ "scoreError": 7.68600918906523e-06,
+ "scoreConfidence": [
+ 528.0007499434031,
+ 528.0007653154215
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0007561237613,
+ "50.0": 528.0007568826769,
+ "90.0": 528.0007611279741,
+ "95.0": 528.0007611279741,
+ "99.0": 528.0007611279741,
+ "99.9": 528.0007611279741,
+ "99.99": 528.0007611279741,
+ "99.999": 528.0007611279741,
+ "99.9999": 528.0007611279741,
+ "100.0": 528.0007611279741
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0007568826769,
+ 528.0007567877292,
+ 528.0007572249199,
+ 528.0007561237613,
+ 528.0007611279741
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-string-1-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8586305.864112541,
+ "scoreError": 48705.60277143552,
+ "scoreConfidence": [
+ 8537600.261341106,
+ 8635011.466883976
+ ],
+ "scorePercentiles": {
+ "0.0": 8567839.209879762,
+ "50.0": 8590959.961186854,
+ "90.0": 8600779.581412775,
+ "95.0": 8600779.581412775,
+ "99.0": 8600779.581412775,
+ "99.9": 8600779.581412775,
+ "99.99": 8600779.581412775,
+ "99.999": 8600779.581412775,
+ "99.9999": 8600779.581412775,
+ "100.0": 8600779.581412775
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8567839.209879762,
+ 8600779.581412775,
+ 8591787.877058808,
+ 8590959.961186854,
+ 8580162.691024503
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0006836341037,
+ "scoreError": 5.727016778031646e-06,
+ "scoreConfidence": [
+ 528.0006779070869,
+ 528.0006893611204
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006819186514,
+ "50.0": 528.0006834049817,
+ "90.0": 528.0006859854044,
+ "95.0": 528.0006859854044,
+ "99.0": 528.0006859854044,
+ "99.9": 528.0006859854044,
+ "99.99": 528.0006859854044,
+ "99.999": 528.0006859854044,
+ "99.9999": 528.0006859854044,
+ "100.0": 528.0006859854044
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0006837782324,
+ 528.0006830832484,
+ 528.0006834049817,
+ 528.0006819186514,
+ 528.0006859854044
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 2,
+ "baseline": 8340276.573981364,
+ "current": 8270848.431381231,
+ "changePercent": -0.832444128012777,
+ "bytesPerOp": {
+ "baseline": 528.0007033340469,
+ "current": 528.0007100246951
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-string-2-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8340276.573981364,
+ "scoreError": 151887.47725277377,
+ "scoreConfidence": [
+ 8188389.09672859,
+ 8492164.051234137
+ ],
+ "scorePercentiles": {
+ "0.0": 8297797.043594185,
+ "50.0": 8334095.375718523,
+ "90.0": 8387051.174751796,
+ "95.0": 8387051.174751796,
+ "99.0": 8387051.174751796,
+ "99.9": 8387051.174751796,
+ "99.99": 8387051.174751796,
+ "99.999": 8387051.174751796,
+ "99.9999": 8387051.174751796,
+ "100.0": 8387051.174751796
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8387051.174751796,
+ 8374319.307731112,
+ 8334095.375718523,
+ 8297797.043594185,
+ 8308119.968111208
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007033340469,
+ "scoreError": 1.3587301360531053e-05,
+ "scoreConfidence": [
+ 528.0006897467455,
+ 528.0007169213483
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006995739703,
+ "50.0": 528.0007029522802,
+ "90.0": 528.0007071252477,
+ "95.0": 528.0007071252477,
+ "99.0": 528.0007071252477,
+ "99.9": 528.0007071252477,
+ "99.99": 528.0007071252477,
+ "99.999": 528.0007071252477,
+ "99.9999": 528.0007071252477,
+ "100.0": 528.0007071252477
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0007002624557,
+ 528.0006995739703,
+ 528.0007029522802,
+ 528.0007067562804,
+ 528.0007071252477
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-string-2-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8270848.431381231,
+ "scoreError": 129232.42012433802,
+ "scoreConfidence": [
+ 8141616.011256893,
+ 8400080.85150557
+ ],
+ "scorePercentiles": {
+ "0.0": 8224806.498983829,
+ "50.0": 8266049.8177848235,
+ "90.0": 8311198.038799844,
+ "95.0": 8311198.038799844,
+ "99.0": 8311198.038799844,
+ "99.9": 8311198.038799844,
+ "99.99": 8311198.038799844,
+ "99.999": 8311198.038799844,
+ "99.9999": 8311198.038799844,
+ "100.0": 8311198.038799844
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8311198.038799844,
+ 8266049.8177848235,
+ 8294525.162445205,
+ 8224806.498983829,
+ 8257662.638892452
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007100246951,
+ "scoreError": 2.0539582223100004e-05,
+ "scoreConfidence": [
+ 528.0006894851128,
+ 528.0007305642773
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0007015048812,
+ "50.0": 528.0007104226532,
+ "90.0": 528.000716151181,
+ "95.0": 528.000716151181,
+ "99.0": 528.000716151181,
+ "99.9": 528.000716151181,
+ "99.99": 528.000716151181,
+ "99.999": 528.000716151181,
+ "99.9999": 528.000716151181,
+ "100.0": 528.000716151181
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0007015048812,
+ 528.0007118995312,
+ 528.0007101452283,
+ 528.000716151181,
+ 528.0007104226532
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 3,
+ "baseline": 8619720.172416156,
+ "current": 8401210.110169353,
+ "changePercent": -2.535001808365589,
+ "bytesPerOp": {
+ "baseline": 528.0006807328953,
+ "current": 528.0006997464873
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-string-3-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8619720.172416156,
+ "scoreError": 131888.2740701128,
+ "scoreConfidence": [
+ 8487831.898346044,
+ 8751608.446486268
+ ],
+ "scorePercentiles": {
+ "0.0": 8567976.49947435,
+ "50.0": 8623953.571467672,
+ "90.0": 8655059.642564042,
+ "95.0": 8655059.642564042,
+ "99.0": 8655059.642564042,
+ "99.9": 8655059.642564042,
+ "99.99": 8655059.642564042,
+ "99.999": 8655059.642564042,
+ "99.9999": 8655059.642564042,
+ "100.0": 8655059.642564042
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8655059.642564042,
+ 8644166.442103568,
+ 8607444.70647115,
+ 8623953.571467672,
+ 8567976.49947435
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0006807328953,
+ "scoreError": 1.3389564671490564e-05,
+ "scoreConfidence": [
+ 528.0006673433306,
+ 528.0006941224599
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006777369066,
+ "50.0": 528.0006795373283,
+ "90.0": 528.0006866702928,
+ "95.0": 528.0006866702928,
+ "99.0": 528.0006866702928,
+ "99.9": 528.0006866702928,
+ "99.99": 528.0006866702928,
+ "99.999": 528.0006866702928,
+ "99.9999": 528.0006866702928,
+ "100.0": 528.0006866702928
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0006790910652,
+ 528.0006777369066,
+ 528.0006806288835,
+ 528.0006795373283,
+ 528.0006866702928
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-string-3-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8401210.110169353,
+ "scoreError": 1152711.9079017532,
+ "scoreConfidence": [
+ 7248498.2022676,
+ 9553922.018071106
+ ],
+ "scorePercentiles": {
+ "0.0": 7877331.732185825,
+ "50.0": 8479509.432548821,
+ "90.0": 8614641.772121916,
+ "95.0": 8614641.772121916,
+ "99.0": 8614641.772121916,
+ "99.9": 8614641.772121916,
+ "99.99": 8614641.772121916,
+ "99.999": 8614641.772121916,
+ "99.9999": 8614641.772121916,
+ "100.0": 8614641.772121916
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8479509.432548821,
+ 7877331.732185825,
+ 8465435.306014046,
+ 8569132.307976156,
+ 8614641.772121916
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0006997464873,
+ "scoreError": 9.672280303942653e-05,
+ "scoreConfidence": [
+ 528.0006030236842,
+ 528.0007964692903
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006816496059,
+ "50.0": 528.000691503886,
+ "90.0": 528.0007431273343,
+ "95.0": 528.0007431273343,
+ "99.0": 528.0007431273343,
+ "99.9": 528.0007431273343,
+ "99.99": 528.0007431273343,
+ "99.999": 528.0007431273343,
+ "99.9999": 528.0007431273343,
+ "100.0": 528.0007431273343
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.000691503886,
+ 528.0007431273343,
+ 528.0006983404976,
+ 528.0006841111127,
+ 528.0006816496059
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 4,
+ "baseline": 8427212.62617099,
+ "current": 8127303.694033952,
+ "changePercent": -3.5588152980222665,
+ "bytesPerOp": {
+ "baseline": 528.0006960425264,
+ "current": 528.0007225841354
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-string-4-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8427212.62617099,
+ "scoreError": 145480.17619138976,
+ "scoreConfidence": [
+ 8281732.4499796,
+ 8572692.802362379
+ ],
+ "scorePercentiles": {
+ "0.0": 8370071.391779255,
+ "50.0": 8434549.150815213,
+ "90.0": 8474713.930924766,
+ "95.0": 8474713.930924766,
+ "99.0": 8474713.930924766,
+ "99.9": 8474713.930924766,
+ "99.99": 8474713.930924766,
+ "99.999": 8474713.930924766,
+ "99.9999": 8474713.930924766,
+ "100.0": 8474713.930924766
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8436474.97403194,
+ 8370071.391779255,
+ 8420253.683303768,
+ 8474713.930924766,
+ 8434549.150815213
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0006960425264,
+ "scoreError": 1.1438363931649776e-05,
+ "scoreConfidence": [
+ 528.0006846041625,
+ 528.0007074808904
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006925492847,
+ "50.0": 528.0006948096843,
+ "90.0": 528.0006998763212,
+ "95.0": 528.0006998763212,
+ "99.0": 528.0006998763212,
+ "99.9": 528.0006998763212,
+ "99.99": 528.0006998763212,
+ "99.999": 528.0006998763212,
+ "99.9999": 528.0006998763212,
+ "100.0": 528.0006998763212
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0006948096843,
+ 528.0006998763212,
+ 528.0006982882451,
+ 528.0006925492847,
+ 528.0006946890971
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-string-4-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8127303.694033952,
+ "scoreError": 250619.82680084393,
+ "scoreConfidence": [
+ 7876683.867233109,
+ 8377923.520834796
+ ],
+ "scorePercentiles": {
+ "0.0": 8062624.351807092,
+ "50.0": 8106339.79964073,
+ "90.0": 8198662.237340811,
+ "95.0": 8198662.237340811,
+ "99.0": 8198662.237340811,
+ "99.9": 8198662.237340811,
+ "99.99": 8198662.237340811,
+ "99.999": 8198662.237340811,
+ "99.9999": 8198662.237340811,
+ "100.0": 8198662.237340811
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8074749.520948258,
+ 8062624.351807092,
+ 8194142.56043287,
+ 8106339.79964073,
+ 8198662.237340811
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007225841354,
+ "scoreError": 2.100344242308327e-05,
+ "scoreConfidence": [
+ 528.000701580693,
+ 528.0007435875777
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0007153652882,
+ "50.0": 528.0007242188602,
+ "90.0": 528.0007281948435,
+ "95.0": 528.0007281948435,
+ "99.0": 528.0007281948435,
+ "99.9": 528.0007281948435,
+ "99.99": 528.0007281948435,
+ "99.999": 528.0007281948435,
+ "99.9999": 528.0007281948435,
+ "100.0": 528.0007281948435
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0007281948435,
+ 528.0007266170129,
+ 528.0007185246717,
+ 528.0007242188602,
+ 528.0007153652882
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 5,
+ "baseline": 8611432.323329074,
+ "current": 7946838.377878162,
+ "changePercent": -7.717577291416122,
+ "bytesPerOp": {
+ "baseline": 528.0006811587577,
+ "current": 528.0007422158081
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-string-5-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8611432.323329074,
+ "scoreError": 179664.85057322503,
+ "scoreConfidence": [
+ 8431767.47275585,
+ 8791097.1739023
+ ],
+ "scorePercentiles": {
+ "0.0": 8554619.520131975,
+ "50.0": 8619506.760627687,
+ "90.0": 8676759.122702036,
+ "95.0": 8676759.122702036,
+ "99.0": 8676759.122702036,
+ "99.9": 8676759.122702036,
+ "99.99": 8676759.122702036,
+ "99.999": 8676759.122702036,
+ "99.9999": 8676759.122702036,
+ "100.0": 8676759.122702036
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8625609.776898941,
+ 8619506.760627687,
+ 8676759.122702036,
+ 8580666.43628473,
+ 8554619.520131975
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0006811587577,
+ "scoreError": 1.5038097793554097e-05,
+ "scoreConfidence": [
+ 528.00066612066,
+ 528.0006961968555
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006759201606,
+ "50.0": 528.0006799131171,
+ "90.0": 528.0006852616034,
+ "95.0": 528.0006852616034,
+ "99.0": 528.0006852616034,
+ "99.9": 528.0006852616034,
+ "99.99": 528.0006852616034,
+ "99.999": 528.0006852616034,
+ "99.9999": 528.0006852616034,
+ "100.0": 528.0006852616034
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0006799131171,
+ 528.0006798651493,
+ 528.0006759201606,
+ 528.0006852616034,
+ 528.0006848337586
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-string-5-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 7946838.377878162,
+ "scoreError": 2194483.360735558,
+ "scoreConfidence": [
+ 5752355.017142604,
+ 10141321.738613721
+ ],
+ "scorePercentiles": {
+ "0.0": 6941338.09254342,
+ "50.0": 8186504.00016715,
+ "90.0": 8287543.913178998,
+ "95.0": 8287543.913178998,
+ "99.0": 8287543.913178998,
+ "99.9": 8287543.913178998,
+ "99.99": 8287543.913178998,
+ "99.999": 8287543.913178998,
+ "99.9999": 8287543.913178998,
+ "100.0": 8287543.913178998
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8186504.00016715,
+ 8287543.913178998,
+ 8269465.644650462,
+ 8049340.238850774,
+ 6941338.09254342
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007422158081,
+ "scoreError": 0.0002206687717830692,
+ "scoreConfidence": [
+ 528.0005215470363,
+ 528.00096288458
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0007085973023,
+ "50.0": 528.0007155951618,
+ "90.0": 528.0008439735444,
+ "95.0": 528.0008439735444,
+ "99.0": 528.0008439735444,
+ "99.9": 528.0008439735444,
+ "99.99": 528.0008439735444,
+ "99.999": 528.0008439735444,
+ "99.9999": 528.0008439735444,
+ "100.0": 528.0008439735444
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0007155951618,
+ 528.0007085973023,
+ 528.0007150939914,
+ 528.000727819041,
+ 528.0008439735444
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 6,
+ "baseline": 8232438.287890455,
+ "current": 7953841.748397452,
+ "changePercent": -3.3841315264130922,
+ "bytesPerOp": {
+ "baseline": 528.0007166503547,
+ "current": 528.0007394894826
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-string-6-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8232438.287890455,
+ "scoreError": 2055642.6962622763,
+ "scoreConfidence": [
+ 6176795.591628179,
+ 10288080.98415273
+ ],
+ "scorePercentiles": {
+ "0.0": 7281388.97456578,
+ "50.0": 8426476.903670084,
+ "90.0": 8529499.40494271,
+ "95.0": 8529499.40494271,
+ "99.0": 8529499.40494271,
+ "99.9": 8529499.40494271,
+ "99.99": 8529499.40494271,
+ "99.999": 8529499.40494271,
+ "99.9999": 8529499.40494271,
+ "100.0": 8529499.40494271
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8505940.41181416,
+ 8529499.40494271,
+ 8418885.74445954,
+ 8426476.903670084,
+ 7281388.97456578
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007166503547,
+ "scoreError": 0.00020715927416057185,
+ "scoreConfidence": [
+ 528.0005094910805,
+ 528.0009238096288
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006849905539,
+ "50.0": 528.0006990178916,
+ "90.0": 528.0008121622393,
+ "95.0": 528.0008121622393,
+ "99.0": 528.0008121622393,
+ "99.9": 528.0008121622393,
+ "99.99": 528.0008121622393,
+ "99.999": 528.0008121622393,
+ "99.9999": 528.0008121622393,
+ "100.0": 528.0008121622393
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0006849905539,
+ 528.0006874880102,
+ 528.0006995930779,
+ 528.0006990178916,
+ 528.0008121622393
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-string-6-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 7953841.748397452,
+ "scoreError": 1345044.7604454085,
+ "scoreConfidence": [
+ 6608796.987952043,
+ 9298886.50884286
+ ],
+ "scorePercentiles": {
+ "0.0": 7329721.641001762,
+ "50.0": 8095479.840009848,
+ "90.0": 8136056.841994592,
+ "95.0": 8136056.841994592,
+ "99.0": 8136056.841994592,
+ "99.9": 8136056.841994592,
+ "99.99": 8136056.841994592,
+ "99.999": 8136056.841994592,
+ "99.9999": 8136056.841994592,
+ "100.0": 8136056.841994592
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8094409.212949782,
+ 8095479.840009848,
+ 8113541.206031276,
+ 8136056.841994592,
+ 7329721.641001762
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007394894826,
+ "scoreError": 0.00012919281505005892,
+ "scoreConfidence": [
+ 528.0006102966676,
+ 528.0008686822977
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0007212051966,
+ "50.0": 528.0007254617611,
+ "90.0": 528.0007992533062,
+ "95.0": 528.0007992533062,
+ "99.0": 528.0007992533062,
+ "99.9": 528.0007992533062,
+ "99.99": 528.0007992533062,
+ "99.999": 528.0007992533062,
+ "99.9999": 528.0007992533062,
+ "100.0": 528.0007992533062
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0007291592252,
+ 528.0007254617611,
+ 528.000722367924,
+ 528.0007212051966,
+ 528.0007992533062
+ ]
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "medianBaseline": 8383744.600076176,
+ "medianCurrent": 8199076.062707592,
+ "medianChangePercent": -2.959566667389341,
+ "geometricMeanChangePercent": -1.3461873082022837,
+ "lower95ChangePercent": -6.265287411205402
+ },
+ {
+ "case": "MediaContent compact UTF-8",
+ "pairs": [
+ {
+ "pair": 1,
+ "baseline": 11122206.967955248,
+ "current": 10947061.867849775,
+ "changePercent": -1.574733329545952,
+ "bytesPerOp": {
+ "baseline": 504.0005284066075,
+ "current": 504.00053623053265
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-bytes-1-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 11122206.967955248,
+ "scoreError": 310513.2070654718,
+ "scoreConfidence": [
+ 10811693.760889776,
+ 11432720.17502072
+ ],
+ "scorePercentiles": {
+ "0.0": 10982918.201227628,
+ "50.0": 11143405.516395817,
+ "90.0": 11188627.031359864,
+ "95.0": 11188627.031359864,
+ "99.0": 11188627.031359864,
+ "99.9": 11188627.031359864,
+ "99.99": 11188627.031359864,
+ "99.999": 11188627.031359864,
+ "99.9999": 11188627.031359864,
+ "100.0": 11188627.031359864
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 11133662.95382252,
+ 10982918.201227628,
+ 11162421.136970408,
+ 11143405.516395817,
+ 11188627.031359864
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.0005284066075,
+ "scoreError": 1.4211016666288207e-05,
+ "scoreConfidence": [
+ 504.0005141955908,
+ 504.00054261762415
+ ],
+ "scorePercentiles": {
+ "0.0": 504.0005248350464,
+ "50.0": 504.0005264798438,
+ "90.0": 504.00053391609504,
+ "95.0": 504.00053391609504,
+ "99.0": 504.00053391609504,
+ "99.9": 504.00053391609504,
+ "99.99": 504.00053391609504,
+ "99.999": 504.00053391609504,
+ "99.9999": 504.00053391609504,
+ "100.0": 504.00053391609504
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.0005303577872,
+ 504.00053391609504,
+ 504.0005248350464,
+ 504.0005264798438,
+ 504.0005264442647
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-bytes-1-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10947061.867849775,
+ "scoreError": 385914.23951845686,
+ "scoreConfidence": [
+ 10561147.628331318,
+ 11332976.10736823
+ ],
+ "scorePercentiles": {
+ "0.0": 10772999.66000177,
+ "50.0": 10985207.305396587,
+ "90.0": 11013907.660538761,
+ "95.0": 11013907.660538761,
+ "99.0": 11013907.660538761,
+ "99.9": 11013907.660538761,
+ "99.99": 11013907.660538761,
+ "99.999": 11013907.660538761,
+ "99.9999": 11013907.660538761,
+ "100.0": 11013907.660538761
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 10772999.66000177,
+ 11013907.660538761,
+ 11009617.619334986,
+ 10985207.305396587,
+ 10953577.093976766
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.00053623053265,
+ "scoreError": 1.654433072945139e-05,
+ "scoreConfidence": [
+ 504.0005196862019,
+ 504.00055277486337
+ ],
+ "scorePercentiles": {
+ "0.0": 504.0005334528287,
+ "50.0": 504.00053484383113,
+ "90.0": 504.0005438041241,
+ "95.0": 504.0005438041241,
+ "99.0": 504.0005438041241,
+ "99.9": 504.0005438041241,
+ "99.99": 504.0005438041241,
+ "99.999": 504.0005438041241,
+ "99.9999": 504.0005438041241,
+ "100.0": 504.0005438041241
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.0005438041241,
+ 504.00053380800665,
+ 504.0005334528287,
+ 504.0005352438728,
+ 504.00053484383113
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 2,
+ "baseline": 10526431.725313628,
+ "current": 10978140.007805401,
+ "changePercent": 4.291181421008217,
+ "bytesPerOp": {
+ "baseline": 504.0005578958251,
+ "current": 504.00053462202686
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-bytes-2-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10526431.725313628,
+ "scoreError": 1785959.2034778409,
+ "scoreConfidence": [
+ 8740472.521835787,
+ 12312390.928791469
+ ],
+ "scorePercentiles": {
+ "0.0": 9699376.136752928,
+ "50.0": 10719806.764736637,
+ "90.0": 10773302.300078249,
+ "95.0": 10773302.300078249,
+ "99.0": 10773302.300078249,
+ "99.9": 10773302.300078249,
+ "99.99": 10773302.300078249,
+ "99.999": 10773302.300078249,
+ "99.9999": 10773302.300078249,
+ "100.0": 10773302.300078249
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 9699376.136752928,
+ 10773302.300078249,
+ 10679214.761730589,
+ 10760458.663269732,
+ 10719806.764736637
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.0005578958251,
+ "scoreError": 0.00010294964423369412,
+ "scoreConfidence": [
+ 504.00045494618087,
+ 504.0006608454694
+ ],
+ "scorePercentiles": {
+ "0.0": 504.0005443280701,
+ "50.0": 504.0005465062121,
+ "90.0": 504.0006056204416,
+ "95.0": 504.0006056204416,
+ "99.0": 504.0006056204416,
+ "99.9": 504.0006056204416,
+ "99.99": 504.0006056204416,
+ "99.999": 504.0006056204416,
+ "99.9999": 504.0006056204416,
+ "100.0": 504.0006056204416
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.0006056204416,
+ 504.0005443280701,
+ 504.00054858217874,
+ 504.0005444422232,
+ 504.0005465062121
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-bytes-2-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10978140.007805401,
+ "scoreError": 169883.76766565585,
+ "scoreConfidence": [
+ 10808256.240139745,
+ 11148023.775471058
+ ],
+ "scorePercentiles": {
+ "0.0": 10924595.068472372,
+ "50.0": 10978964.405319922,
+ "90.0": 11043951.915756091,
+ "95.0": 11043951.915756091,
+ "99.0": 11043951.915756091,
+ "99.9": 11043951.915756091,
+ "99.99": 11043951.915756091,
+ "99.999": 11043951.915756091,
+ "99.9999": 11043951.915756091,
+ "100.0": 11043951.915756091
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 10978964.405319922,
+ 10955766.352262024,
+ 10987422.2972166,
+ 10924595.068472372,
+ 11043951.915756091
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.00053462202686,
+ "scoreError": 9.97951276782495e-06,
+ "scoreConfidence": [
+ 504.0005246425141,
+ 504.0005446015396
+ ],
+ "scorePercentiles": {
+ "0.0": 504.00053166523367,
+ "50.0": 504.0005336622801,
+ "90.0": 504.00053784700975,
+ "95.0": 504.00053784700975,
+ "99.0": 504.00053784700975,
+ "99.9": 504.00053784700975,
+ "99.99": 504.00053784700975,
+ "99.999": 504.00053784700975,
+ "99.9999": 504.00053784700975,
+ "100.0": 504.00053784700975
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.0005336622801,
+ 504.00053677932044,
+ 504.00053315629066,
+ 504.00053784700975,
+ 504.00053166523367
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 3,
+ "baseline": 10989663.87159383,
+ "current": 10782752.22006754,
+ "changePercent": -1.8827841683230706,
+ "bytesPerOp": {
+ "baseline": 504.0005346652891,
+ "current": 504.0005442895799
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-bytes-3-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10989663.87159383,
+ "scoreError": 361133.35600759595,
+ "scoreConfidence": [
+ 10628530.515586233,
+ 11350797.227601426
+ ],
+ "scorePercentiles": {
+ "0.0": 10861354.623179004,
+ "50.0": 11015921.648730455,
+ "90.0": 11075460.520514706,
+ "95.0": 11075460.520514706,
+ "99.0": 11075460.520514706,
+ "99.9": 11075460.520514706,
+ "99.99": 11075460.520514706,
+ "99.999": 11075460.520514706,
+ "99.9999": 11075460.520514706,
+ "100.0": 11075460.520514706
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 11075460.520514706,
+ 11070374.805584187,
+ 11015921.648730455,
+ 10861354.623179004,
+ 10925207.759960793
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.0005346652891,
+ "scoreError": 1.591790470750439e-05,
+ "scoreConfidence": [
+ 504.0005187473844,
+ 504.0005505831938
+ ],
+ "scorePercentiles": {
+ "0.0": 504.0005291883601,
+ "50.0": 504.0005336313742,
+ "90.0": 504.00054040043966,
+ "95.0": 504.00054040043966,
+ "99.0": 504.00054040043966,
+ "99.9": 504.00054040043966,
+ "99.99": 504.00054040043966,
+ "99.999": 504.00054040043966,
+ "99.9999": 504.00054040043966,
+ "100.0": 504.00054040043966
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.00053362211423,
+ 504.0005291883601,
+ 504.0005336313742,
+ 504.00054040043966,
+ 504.0005364841573
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-bytes-3-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10782752.22006754,
+ "scoreError": 215185.63932878312,
+ "scoreConfidence": [
+ 10567566.580738757,
+ 10997937.859396324
+ ],
+ "scorePercentiles": {
+ "0.0": 10684293.317894747,
+ "50.0": 10806290.336876675,
+ "90.0": 10817980.418496404,
+ "95.0": 10817980.418496404,
+ "99.0": 10817980.418496404,
+ "99.9": 10817980.418496404,
+ "99.99": 10817980.418496404,
+ "99.999": 10817980.418496404,
+ "99.9999": 10817980.418496404,
+ "100.0": 10817980.418496404
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 10684293.317894747,
+ 10792238.111637497,
+ 10806290.336876675,
+ 10812958.915432382,
+ 10817980.418496404
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.0005442895799,
+ "scoreError": 1.5808271593356252e-05,
+ "scoreConfidence": [
+ 504.0005284813083,
+ 504.0005600978515
+ ],
+ "scorePercentiles": {
+ "0.0": 504.00054153434115,
+ "50.0": 504.00054283846436,
+ "90.0": 504.00055152177623,
+ "95.0": 504.00055152177623,
+ "99.0": 504.00055152177623,
+ "99.9": 504.00055152177623,
+ "99.99": 504.00055152177623,
+ "99.999": 504.00055152177623,
+ "99.9999": 504.00055152177623,
+ "100.0": 504.00055152177623
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.00055152177623,
+ 504.00054283846436,
+ 504.0005421300315,
+ 504.0005434232861,
+ 504.00054153434115
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 4,
+ "baseline": 10702182.80204327,
+ "current": 10999288.597920034,
+ "changePercent": 2.7761233513974304,
+ "bytesPerOp": {
+ "baseline": 504.0005483874205,
+ "current": 504.0005349273212
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-bytes-4-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10702182.80204327,
+ "scoreError": 728187.7709887801,
+ "scoreConfidence": [
+ 9973995.03105449,
+ 11430370.573032051
+ ],
+ "scorePercentiles": {
+ "0.0": 10364267.220925957,
+ "50.0": 10783631.401068112,
+ "90.0": 10796100.99226566,
+ "95.0": 10796100.99226566,
+ "99.0": 10796100.99226566,
+ "99.9": 10796100.99226566,
+ "99.99": 10796100.99226566,
+ "99.999": 10796100.99226566,
+ "99.9999": 10796100.99226566,
+ "100.0": 10796100.99226566
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 10796100.99226566,
+ 10793329.51410619,
+ 10783631.401068112,
+ 10773584.88185044,
+ 10364267.220925957
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.0005483874205,
+ "scoreError": 4.1099857372541304e-05,
+ "scoreConfidence": [
+ 504.00050728756315,
+ 504.00058948727786
+ ],
+ "scorePercentiles": {
+ "0.0": 504.00054269631954,
+ "50.0": 504.0005439042403,
+ "90.0": 504.00056744899393,
+ "95.0": 504.00056744899393,
+ "99.0": 504.00056744899393,
+ "99.9": 504.00056744899393,
+ "99.99": 504.00056744899393,
+ "99.999": 504.00056744899393,
+ "99.9999": 504.00056744899393,
+ "100.0": 504.00056744899393
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.00054269631954,
+ 504.00054351277623,
+ 504.00054437477246,
+ 504.0005439042403,
+ 504.00056744899393
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-bytes-4-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10999288.597920034,
+ "scoreError": 168622.5963103002,
+ "scoreConfidence": [
+ 10830666.001609733,
+ 11167911.194230335
+ ],
+ "scorePercentiles": {
+ "0.0": 10954966.721378582,
+ "50.0": 10996337.024679625,
+ "90.0": 11068311.861464404,
+ "95.0": 11068311.861464404,
+ "99.0": 11068311.861464404,
+ "99.9": 11068311.861464404,
+ "99.99": 11068311.861464404,
+ "99.999": 11068311.861464404,
+ "99.9999": 11068311.861464404,
+ "100.0": 11068311.861464404
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 10996337.024679625,
+ 10954966.721378582,
+ 11068311.861464404,
+ 11007077.043912297,
+ 10969750.33816526
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.0005349273212,
+ "scoreError": 9.169119006637945e-06,
+ "scoreConfidence": [
+ 504.00052575820223,
+ 504.0005440964402
+ ],
+ "scorePercentiles": {
+ "0.0": 504.0005321731479,
+ "50.0": 504.00053459000725,
+ "90.0": 504.00053874461037,
+ "95.0": 504.00053874461037,
+ "99.0": 504.00053874461037,
+ "99.9": 504.00053874461037,
+ "99.99": 504.00053874461037,
+ "99.999": 504.00053874461037,
+ "99.9999": 504.00053874461037,
+ "100.0": 504.00053874461037
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.00053459000725,
+ 504.00053874461037,
+ 504.0005321731479,
+ 504.0005348345519,
+ 504.00053429428874
+ ]
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "medianBaseline": 10845923.33681855,
+ "medianCurrent": 10962600.937827587,
+ "medianChangePercent": 0.6006950109257392,
+ "geometricMeanChangePercent": 0.8667224089766439,
+ "lower95ChangePercent": -2.7138790614917903
+ },
+ {
+ "case": "GoogleMapsAPIPrettyPrinting UTF-8",
+ "pairs": [
+ {
+ "pair": 1,
+ "baseline": 174597.81292143487,
+ "current": 205543.64294864787,
+ "changePercent": 17.724065101054798,
+ "bytesPerOp": {
+ "baseline": 25408.033722050004,
+ "current": 26200.028663394973
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-pretty-1-baseline",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.jsoniterScala",
+ "primaryMetric": {
+ "score": 174597.81292143487,
+ "scoreError": 3674.771783638936,
+ "scoreConfidence": [
+ 170923.04113779592,
+ 178272.58470507382
+ ],
+ "scorePercentiles": {
+ "0.0": 173099.40298585425,
+ "50.0": 174860.04332010643,
+ "90.0": 175485.05964719734,
+ "95.0": 175485.05964719734,
+ "99.0": 175485.05964719734,
+ "99.9": 175485.05964719734,
+ "99.99": 175485.05964719734,
+ "99.999": 175485.05964719734,
+ "99.9999": 175485.05964719734,
+ "100.0": 175485.05964719734
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 175485.05964719734,
+ 174860.04332010643,
+ 175262.62401628782,
+ 174281.93463772858,
+ 173099.40298585425
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 25408.033722050004,
+ "scoreError": 0.0009813706530393139,
+ "scoreConfidence": [
+ 25408.03274067935,
+ 25408.034703420657
+ ],
+ "scorePercentiles": {
+ "0.0": 25408.0333658103,
+ "50.0": 25408.033724123,
+ "90.0": 25408.03402768198,
+ "95.0": 25408.03402768198,
+ "99.0": 25408.03402768198,
+ "99.9": 25408.03402768198,
+ "99.99": 25408.03402768198,
+ "99.999": 25408.03402768198,
+ "99.9999": 25408.03402768198,
+ "100.0": 25408.03402768198
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 25408.033607911482,
+ 25408.0333658103,
+ 25408.033724123,
+ 25408.033884723256,
+ 25408.03402768198
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-pretty-1-current",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.fory",
+ "primaryMetric": {
+ "score": 205543.64294864787,
+ "scoreError": 2035.7920858449818,
+ "scoreConfidence": [
+ 203507.85086280288,
+ 207579.43503449287
+ ],
+ "scorePercentiles": {
+ "0.0": 204655.66707941596,
+ "50.0": 205686.9493881752,
+ "90.0": 206076.14206301537,
+ "95.0": 206076.14206301537,
+ "99.0": 206076.14206301537,
+ "99.9": 206076.14206301537,
+ "99.99": 206076.14206301537,
+ "99.999": 206076.14206301537,
+ "99.9999": 206076.14206301537,
+ "100.0": 206076.14206301537
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 204655.66707941596,
+ 205611.34955705435,
+ 205686.9493881752,
+ 206076.14206301537,
+ 205688.10665557842
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 26200.028663394973,
+ "scoreError": 0.0007862574785616849,
+ "scoreConfidence": [
+ 26200.027877137494,
+ 26200.02944965245
+ ],
+ "scorePercentiles": {
+ "0.0": 26200.028442108618,
+ "50.0": 26200.028683613124,
+ "90.0": 26200.02894666828,
+ "95.0": 26200.02894666828,
+ "99.0": 26200.02894666828,
+ "99.9": 26200.02894666828,
+ "99.99": 26200.02894666828,
+ "99.999": 26200.02894666828,
+ "99.9999": 26200.02894666828,
+ "100.0": 26200.02894666828
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 26200.028683613124,
+ 26200.02849234462,
+ 26200.02894666828,
+ 26200.028442108618,
+ 26200.0287522402
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 2,
+ "baseline": 164985.2309051822,
+ "current": 202799.9735029379,
+ "changePercent": 22.92007738528308,
+ "bytesPerOp": {
+ "baseline": 25408.035612909687,
+ "current": 26120.028977361933
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-pretty-2-baseline",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.jsoniterScala",
+ "primaryMetric": {
+ "score": 164985.2309051822,
+ "scoreError": 4660.460397774469,
+ "scoreConfidence": [
+ 160324.77050740772,
+ 169645.69130295666
+ ],
+ "scorePercentiles": {
+ "0.0": 163584.82394618526,
+ "50.0": 164677.05662426073,
+ "90.0": 166542.06285238217,
+ "95.0": 166542.06285238217,
+ "99.0": 166542.06285238217,
+ "99.9": 166542.06285238217,
+ "99.99": 166542.06285238217,
+ "99.999": 166542.06285238217,
+ "99.9999": 166542.06285238217,
+ "100.0": 166542.06285238217
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 164234.05682526025,
+ 163584.82394618526,
+ 164677.05662426073,
+ 165888.15427782256,
+ 166542.06285238217
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 25408.035612909687,
+ "scoreError": 0.0010434505732795133,
+ "scoreConfidence": [
+ 25408.034569459112,
+ 25408.036656360262
+ ],
+ "scorePercentiles": {
+ "0.0": 25408.03519741758,
+ "50.0": 25408.035671012454,
+ "90.0": 25408.035886683894,
+ "95.0": 25408.035886683894,
+ "99.0": 25408.035886683894,
+ "99.9": 25408.035886683894,
+ "99.99": 25408.035886683894,
+ "99.999": 25408.035886683894,
+ "99.9999": 25408.035886683894,
+ "100.0": 25408.035886683894
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 25408.035671012454,
+ 25408.035886683894,
+ 25408.035794832726,
+ 25408.03551460178,
+ 25408.03519741758
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-pretty-2-current",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.fory",
+ "primaryMetric": {
+ "score": 202799.9735029379,
+ "scoreError": 4353.887460104229,
+ "scoreConfidence": [
+ 198446.0860428337,
+ 207153.86096304213
+ ],
+ "scorePercentiles": {
+ "0.0": 201203.39887319936,
+ "50.0": 202837.49882023153,
+ "90.0": 204068.08551412937,
+ "95.0": 204068.08551412937,
+ "99.0": 204068.08551412937,
+ "99.9": 204068.08551412937,
+ "99.99": 204068.08551412937,
+ "99.999": 204068.08551412937,
+ "99.9999": 204068.08551412937,
+ "100.0": 204068.08551412937
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 201203.39887319936,
+ 202837.49882023153,
+ 202269.8101404362,
+ 203621.07416669314,
+ 204068.08551412937
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 26120.028977361933,
+ "scoreError": 0.0007090324545536642,
+ "scoreConfidence": [
+ 26120.02826832948,
+ 26120.029686394388
+ ],
+ "scorePercentiles": {
+ "0.0": 26120.028708227288,
+ "50.0": 26120.028992604926,
+ "90.0": 26120.02916714139,
+ "95.0": 26120.02916714139,
+ "99.0": 26120.02916714139,
+ "99.9": 26120.02916714139,
+ "99.99": 26120.02916714139,
+ "99.999": 26120.02916714139,
+ "99.9999": 26120.02916714139,
+ "100.0": 26120.02916714139
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 26120.02916714139,
+ 26120.02889787585,
+ 26120.029120960204,
+ 26120.028992604926,
+ 26120.028708227288
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 3,
+ "baseline": 165230.6073705634,
+ "current": 205899.9655676436,
+ "changePercent": 24.61369527370365,
+ "bytesPerOp": {
+ "baseline": 25408.03564430193,
+ "current": 26200.028587543013
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-pretty-3-baseline",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.jsoniterScala",
+ "primaryMetric": {
+ "score": 165230.6073705634,
+ "scoreError": 2082.6528168390482,
+ "scoreConfidence": [
+ 163147.95455372435,
+ 167313.26018740245
+ ],
+ "scorePercentiles": {
+ "0.0": 164605.0614016727,
+ "50.0": 165148.60445531708,
+ "90.0": 165980.0737867756,
+ "95.0": 165980.0737867756,
+ "99.0": 165980.0737867756,
+ "99.9": 165980.0737867756,
+ "99.99": 165980.0737867756,
+ "99.999": 165980.0737867756,
+ "99.9999": 165980.0737867756,
+ "100.0": 165980.0737867756
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 165148.60445531708,
+ 165980.0737867756,
+ 164885.9973916252,
+ 164605.0614016727,
+ 165533.2998174265
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 25408.03564430193,
+ "scoreError": 0.0004417309661412433,
+ "scoreConfidence": [
+ 25408.035202570965,
+ 25408.036086032895
+ ],
+ "scorePercentiles": {
+ "0.0": 25408.03551609323,
+ "50.0": 25408.035610521947,
+ "90.0": 25408.035818439235,
+ "95.0": 25408.035818439235,
+ "99.0": 25408.035818439235,
+ "99.9": 25408.035818439235,
+ "99.99": 25408.035818439235,
+ "99.999": 25408.035818439235,
+ "99.9999": 25408.035818439235,
+ "100.0": 25408.035818439235
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 25408.03568651327,
+ 25408.035610521947,
+ 25408.035818439235,
+ 25408.035589941974,
+ 25408.03551609323
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-pretty-3-current",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.fory",
+ "primaryMetric": {
+ "score": 205899.9655676436,
+ "scoreError": 7231.779174096243,
+ "scoreConfidence": [
+ 198668.18639354737,
+ 213131.74474173985
+ ],
+ "scorePercentiles": {
+ "0.0": 202967.4539848817,
+ "50.0": 205810.99566965742,
+ "90.0": 207702.17134753993,
+ "95.0": 207702.17134753993,
+ "99.0": 207702.17134753993,
+ "99.9": 207702.17134753993,
+ "99.99": 207702.17134753993,
+ "99.999": 207702.17134753993,
+ "99.9999": 207702.17134753993,
+ "100.0": 207702.17134753993
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 202967.4539848817,
+ 207702.17134753993,
+ 207378.44945612934,
+ 205810.99566965742,
+ 205640.75738000963
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 26200.028587543013,
+ "scoreError": 0.0009425194070230298,
+ "scoreConfidence": [
+ 26200.027645023605,
+ 26200.02953006242
+ ],
+ "scorePercentiles": {
+ "0.0": 26200.02828634156,
+ "50.0": 26200.028600712103,
+ "90.0": 26200.028863877014,
+ "95.0": 26200.028863877014,
+ "99.0": 26200.028863877014,
+ "99.9": 26200.028863877014,
+ "99.99": 26200.028863877014,
+ "99.999": 26200.028863877014,
+ "99.9999": 26200.028863877014,
+ "100.0": 26200.028863877014
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 26200.028863877014,
+ 26200.02840322991,
+ 26200.02828634156,
+ 26200.028600712103,
+ 26200.028783554477
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 4,
+ "baseline": 175334.68707402513,
+ "current": 211121.99886334353,
+ "changePercent": 20.41085673721208,
+ "bytesPerOp": {
+ "baseline": 25408.033453005406,
+ "current": 26120.027906346735
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-pretty-4-baseline",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.jsoniterScala",
+ "primaryMetric": {
+ "score": 175334.68707402513,
+ "scoreError": 5296.881698351415,
+ "scoreConfidence": [
+ 170037.80537567372,
+ 180631.56877237654
+ ],
+ "scorePercentiles": {
+ "0.0": 173014.0137898809,
+ "50.0": 175662.20174572137,
+ "90.0": 176697.78384199797,
+ "95.0": 176697.78384199797,
+ "99.0": 176697.78384199797,
+ "99.9": 176697.78384199797,
+ "99.99": 176697.78384199797,
+ "99.999": 176697.78384199797,
+ "99.9999": 176697.78384199797,
+ "100.0": 176697.78384199797
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 175550.70748284203,
+ 176697.78384199797,
+ 173014.0137898809,
+ 175662.20174572137,
+ 175748.72850968337
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 25408.033453005406,
+ "scoreError": 0.0011952584224599013,
+ "scoreConfidence": [
+ 25408.032257746985,
+ 25408.034648263827
+ ],
+ "scorePercentiles": {
+ "0.0": 25408.0330382682,
+ "50.0": 25408.033393829402,
+ "90.0": 25408.033858928797,
+ "95.0": 25408.033858928797,
+ "99.0": 25408.033858928797,
+ "99.9": 25408.033858928797,
+ "99.99": 25408.033858928797,
+ "99.999": 25408.033858928797,
+ "99.9999": 25408.033858928797,
+ "100.0": 25408.033858928797
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 25408.033393829402,
+ 25408.0330382682,
+ 25408.033858928797,
+ 25408.033633306062,
+ 25408.03334069456
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-pretty-4-current",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.fory",
+ "primaryMetric": {
+ "score": 211121.99886334353,
+ "scoreError": 4905.421559449824,
+ "scoreConfidence": [
+ 206216.5773038937,
+ 216027.42042279337
+ ],
+ "scorePercentiles": {
+ "0.0": 208930.38062617683,
+ "50.0": 211423.47887905603,
+ "90.0": 212235.43870714086,
+ "95.0": 212235.43870714086,
+ "99.0": 212235.43870714086,
+ "99.9": 212235.43870714086,
+ "99.99": 212235.43870714086,
+ "99.999": 212235.43870714086,
+ "99.9999": 212235.43870714086,
+ "100.0": 212235.43870714086
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 211677.76066911514,
+ 212235.43870714086,
+ 208930.38062617683,
+ 211342.93543522884,
+ 211423.47887905603
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 26120.027906346735,
+ "scoreError": 0.0008772736345718646,
+ "scoreConfidence": [
+ 26120.027029073102,
+ 26120.028783620368
+ ],
+ "scorePercentiles": {
+ "0.0": 26120.02775225487,
+ "50.0": 26120.027837400834,
+ "90.0": 26120.028306262284,
+ "95.0": 26120.028306262284,
+ "99.0": 26120.028306262284,
+ "99.9": 26120.028306262284,
+ "99.99": 26120.028306262284,
+ "99.999": 26120.028306262284,
+ "99.9999": 26120.028306262284,
+ "100.0": 26120.028306262284
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 26120.02777581221,
+ 26120.02775225487,
+ 26120.028306262284,
+ 26120.027837400834,
+ 26120.027860003484
+ ]
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "medianBaseline": 169914.21014599915,
+ "medianCurrent": 205721.80425814574,
+ "medianChangePercent": 21.66546706124758,
+ "geometricMeanChangePercent": 21.389151036888382,
+ "lower95ChangePercent": 17.893637040735502
+ }
+ ]
+}
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/pretty-printing.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/pretty-printing.md
new file mode 100644
index 00000000000..13392fed02b
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/pretty-printing.md
@@ -0,0 +1,82 @@
+# JVM JSON 格式化输出测量
+
+本次测量覆盖 jsoniter-scala `GoogleMapsAPIPrettyPrinting` 工作负载上的
+`ForyJson.toPrettyJsonBytes`,并检查 Java `JsonSerializationSuite` MediaContent 工作负载的紧凑输出。
+吞吐量越高越好。
+
+格式化输出对比超过了 10% 的提升目标。紧凑输出的吞吐量点估计位于 2% 回退阈值以内,
+但其不确定性**不足以**可靠地证明该阈值,尤其是 String 对照仍无法得出确定结论。
+
+## 结果
+
+| 工作负载 | 参考中位数,ops/s | Fory 中位数,ops/s | 配对几何变化 | 单侧 95% 下界 | 配对数 |
+| --------------------------------------------- | ----------------: | -----------------: | -----------: | ------------: | -----: |
+| Google Maps 格式化 UTF-8,对比 jsoniter-scala | 169,914 | 205,722 | +21.39% | +17.89% | 4 |
+| MediaContent 紧凑 UTF-8,对比 Fory 基线 | 10,845,923 | 10,962,601 | +0.87% | -2.71% | 4 |
+| MediaContent 紧凑 String,对比 Fory 基线 | 8,383,745 | 8,199,076 | -1.35% | -6.27% | 6 |
+
+变化汇总相邻参考/当前运行的比值,不是两个独立中位数相除。下界对比值的对数使用 Student t 分布计算。
+所有配对均保留,没有剔除。String 配对变化介于 -7.72% 和 +10.93%,
+不能把平均值视为稳定低于 2% 回退的保证。
+
+两个版本的紧凑输出分配量均约为 UTF-8 504 B/op、String 528 B/op。
+格式化输出中 Fory 分配 26,120–26,200 B/op,jsoniter-scala 分配 25,408 B/op。
+对比使用各库返回独立字节数组的 API,不使用预分配输出。
+
+[全部迭代样本、分配测量、配对汇总及制品哈希](pretty-printing-results.json)以 JSON 提供。
+
+## 工作负载与格式
+
+原有 Google Maps 模型和输入未修改。适配器调用 `Fory.foryJson.toPrettyJsonBytes(obj)`;
+参考实现调用普通 `jsoniterScala`,而非 `jsoniterScalaPrealloc`。
+Scala 2 和 Scala 3 正确性规格将 Fory 与已有 Jackson 期望输出比较,没有修改 fixture 或预期结果。
+
+两者均对对象和数组使用两个空格的多行缩进。Fory 遵循该工作负载的 Jackson 格式,包括冒号两侧的空格;
+jsoniter-scala 保留原有格式,仅在冒号后加空格。因此两者的输出字节序列和大小不同。
+Fory 在序列化时直接输出缩进,不会对已完成的紧凑文档重新格式化。
+
+紧凑输出对照使用未修改的 `benchmarks/java` MediaContent 模型和 Eishay 输入。
+参考与当前版本之间只替换 Fory JSON runtime jar,core 和基准测试 jar 保持固定。
+
+## 环境与版本
+
+- 日期:2026 年 9 月 21 日。
+- 机器:Apple M4 Pro,12 个 CPU 核心,48 GiB RAM;macOS 15.7.2 arm64。
+- JDK:OpenJDK 25.0.3;JMH 1.37。
+- Fory 源码:`2b8af43f17c98633538594ab6ff942591728c0a4`,版本 `1.8.0-SNAPSHOT`。
+- 紧凑输出参考版本:`509a096aa3ac68c0ca9ee248d085db7855523584`。
+- jsoniter-scala 基准测试检出版本:`84cb277f2c2a16b4018bc61fdeec3eed62252a1e`,
+ 包含 Fory 格式化输出适配器,版本 `2.40.2-SNAPSHOT`。
+- Scala:基准测试为 3.9.0;Fory JSON Scala 和 jsoniter-scala core/macros 为 3.3.8。
+- 每次运行:一个 fork、一个线程、三轮 1 秒预热、五轮 1 秒测量。
+- JVM 参数:`-Xms1g -Xmx1g -XX:+UseParallelGC`;启用 JMH GC profiler。
+- 同一机器上按相邻参考/当前配对串行运行。保留桌面后台活动,测量不确定性如上所示。
+
+## 复现
+
+从各自源码版本构建 Fory core 和 JSON jar,并分别保留。使用
+`mvn -f benchmarks/java/pom.xml -Pjmh -DskipTests package` 构建 Java 基准测试 jar。
+以 Scala 3.9.0 构建 jsoniter-scala 基准测试 assembly 前,先安装当前 Fory JSON Scala 模块。
+以下命令使用对应的固定 jar:
+
+```bash
+java -cp "$RUNTIME_JAR:$CORE_JAR:$MEDIA_BENCHMARK_JAR" org.openjdk.jmh.Main \
+ '.*JsonSerializationSuite.foryToJsonString$' \
+ -t 1 -f 1 -wi 3 -i 5 -w 1s -r 1s -bm thrpt -tu s \
+ -jvmArgs '-Xms1g -Xmx1g -XX:+UseParallelGC' -foe true -prof gc \
+ -rf json -rff "$RESULT_FILE"
+```
+
+紧凑 UTF-8 选择 `.*JsonSerializationSuite.foryToJsonBytes$`。
+每个配对都先运行基线 jar,紧接着运行当前 jar。
+
+```bash
+java -cp "$SCALA_JSON_JAR:$RUNTIME_JAR:$CORE_JAR:$SCALA_BENCHMARK_JAR" org.openjdk.jmh.Main \
+ '.*GoogleMapsAPIPrettyPrinting.fory$' \
+ -t 1 -f 1 -wi 3 -i 5 -w 1s -r 1s -bm thrpt -tu s \
+ -jvmArgs '-Xms1g -Xmx1g -XX:+UseParallelGC' -foe true -prof gc \
+ -rf json -rff "$RESULT_FILE"
+```
+
+使用同一 classpath 和 JVM 设置,在每次 Fory 运行前立即运行
+`.*GoogleMapsAPIPrettyPrinting.jsoniterScala$`。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/scala/README.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/scala/README.md
index 0b436a5e545..cb7fbce885d 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/scala/README.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/benchmarks/json/scala/README.md
@@ -2,6 +2,8 @@
本测试使用同一个不可变 Scala MediaContent 模型和 Eishay JSON 文档,对比 fory-json-scala、jsoniter-scala 和 Jackson Scala。String 组不包含 UTF-8 转换;UTF-8 组中各库均使用直接操作字节数组的 API。
+独立的 Google Maps 工作负载见 [JVM JSON 格式化输出测量](../pretty-printing.md)。
+
- 测试日期:`2026-08-14`
- 源码提交:`588ad6ab355c4c23fa0a2e4f269a8c733cba7b01`
- 平台:macOS-15.7.2-arm64-arm-64bit (arm64)
@@ -24,18 +26,18 @@
## 结果 {#results}
-| 表示形式 | 操作 | fory-json-scala 次/秒 | jsoniter-scala 次/秒 | Jackson Scala 次/秒 | 最快 |
-| ------------- | ----------- | ----------------------: | ---------------------: | --------------------: | --------------- |
-| 字符串 | 序列化 | 6,760,588 | 2,748,997 | 1,955,855 | fory-json-scala |
-| 字符串 | 反序列化 | 3,771,280 | 2,350,297 | 960,362 | fory-json-scala |
-| UTF-8 字节 | 序列化 | 9,485,122 | 2,745,567 | 1,761,719 | fory-json-scala |
-| UTF-8 字节 | 反序列化 | 3,318,893 | 2,391,923 | 1,080,453 | fory-json-scala |
+| 表示形式 | 操作 | fory-json-scala 次/秒 | jsoniter-scala 次/秒 | Jackson Scala 次/秒 | 最快 |
+| ---------- | -------- | --------------------: | -------------------: | ------------------: | --------------- |
+| 字符串 | 序列化 | 6,760,588 | 2,748,997 | 1,955,855 | fory-json-scala |
+| 字符串 | 反序列化 | 3,771,280 | 2,350,297 | 960,362 | fory-json-scala |
+| UTF-8 字节 | 序列化 | 9,485,122 | 2,745,567 | 1,761,719 | fory-json-scala |
+| UTF-8 字节 | 反序列化 | 3,318,893 | 2,391,923 | 1,080,453 | fory-json-scala |
## Fory 性能优势 {#fory-performance-advantage}
-| 表示形式 | 操作 | 相对 jsoniter-scala | 相对 Jackson Scala |
-| ------------- | ----------- | ----------------: | ---------------: |
-| 字符串 | 序列化 | 145.9% | 245.7% |
-| 字符串 | 反序列化 | 60.5% | 292.7% |
-| UTF-8 字节 | 序列化 | 245.5% | 438.4% |
-| UTF-8 字节 | 反序列化 | 38.8% | 207.2% |
+| 表示形式 | 操作 | 相对 jsoniter-scala | 相对 Jackson Scala |
+| ---------- | -------- | ------------------: | -----------------: |
+| 字符串 | 序列化 | 145.9% | 245.7% |
+| 字符串 | 反序列化 | 60.5% | 292.7% |
+| UTF-8 字节 | 序列化 | 245.5% | 438.4% |
+| UTF-8 字节 | 反序列化 | 38.8% | 207.2% |
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/build-integration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/build-integration.md
index 679635fdf68..aae54f53ab6 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/build-integration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/build-integration.md
@@ -211,7 +211,7 @@ cc_library(
```yaml
dependencies:
- fory: ^1.7.4
+ fory: ^1.7.5
dev_dependencies:
build_runner: ^2.4.0
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/cli.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/cli.md
index 46d1757ec97..e6c3e6d5d10 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/cli.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/compiler/cli.md
@@ -659,5 +659,5 @@ fory = "x.y.z"
```yaml
dependencies:
- fory: ^1.7.4
+ fory: ^1.7.5
```
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/csharp.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/csharp.md
index fe98f7d0dea..d4232243667 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/csharp.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/csharp.md
@@ -36,7 +36,7 @@ gRPC 客户端、服务基类、方法描述符、元数据、截止时间、取
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.4" />
+ <PackageReference Include="Apache.Fory" Version="1.7.5" />
<PackageReference Include="Grpc.AspNetCore" Version="2.71.0" />
</ItemGroup>
```
@@ -45,7 +45,7 @@ gRPC 客户端、服务基类、方法描述符、元数据、截止时间、取
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.4" />
+ <PackageReference Include="Apache.Fory" Version="1.7.5" />
<PackageReference Include="Grpc.Core.Api" Version="2.71.0" />
<PackageReference Include="Grpc.Net.Client" Version="2.71.0" />
</ItemGroup>
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/dart.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/dart.md
index e820d9ef72f..5357875e156 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/dart.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/dart.md
@@ -29,7 +29,7 @@ license: |
```yaml
dependencies:
- fory: ^1.7.4
+ fory: ^1.7.5
grpc: ^4.0.0
dev_dependencies:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/rust.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/rust.md
index fef383ec3bb..fef66910370 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/rust.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/grpc/rust.md
@@ -29,7 +29,7 @@ license: |
```toml
[dependencies]
-fory = "1.7.4"
+fory = "1.7.5"
bytes = "1"
tonic = { version = "0.14", features = ["transport"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/annotations.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/annotations.md
index fd81775b196..c2e36b3ba1f 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/annotations.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/annotations.md
@@ -19,7 +19,7 @@ license: |
limitations under the License.
---
-Fory JSON 在 `org.apache.fory.json.annotation` 中提供以下映射和验证注解:`JsonAnyGetter`、`JsonAnyProperty`、`JsonAnySetter`、`JsonByteArray`、`JsonCodec`、`JsonCreator`、`JsonFormat`、`JsonIgnore`、`JsonProperty`、`JsonPropertyOrder`、`JsonRawValue`、`JsonSubTypes`、`JsonUnwrapped`、`JsonValidator` 和 `JsonValue`。`JsonType` 是独立的构建期模型标记。这些属于 Fory JSON API,不是 Jackson、Gson 或 Fory 二进制协议兼容注解。
+Fory JSON 在 `org.apache.fory.json.annotation` 中提供以下映射和验证注解:`JsonAnyGetter`、`JsonAnyProperty`、`JsonAnySetter`、`JsonByteArray`、`JsonCodec`、`JsonCreator`、`JsonFormat`、`JsonIgnore`、`JsonInclude`、`JsonProperty`、`JsonPropertyOrder`、`JsonRawValue`、`JsonSubTypes`、`JsonUnwrapped`、`JsonValidator` 和 `JsonValue`。`JsonType` 是独立的构建期模型标记。这些属于 Fory JSON API,不是 Jackson、Gson 或 Fory 二进制协议兼容注解。
`JsonType` 不会被继承,因此每个需要参与平台构建流程且符合要求的具体模型都必须单独标注。Java 源码需要使用 `fory-annotation-processor`。未标注的普通 Java 类仍可使用反射;在 Android 上,它们需要由应用编写精确 R8 规则。经过 Android 脱糖处理的 Record 必须直接声明 `JsonType`,或使用已编译的精确 `JsonMixin` 配对。在 Native Image 之外,直接标注的 Java 模型如果使用默认对象编解码器却未运行注解处理器,会在创建编解码器时失败。
@@ -29,13 +29,13 @@ Kotlin/JVM 模型使用 Kotlin JSON 模块。平台设置见 [Kotlin 指南](kot
Kotlin 注解与对应 Java 字段、访问器或选定构造函数参数合并为同一个逻辑属性。请显式指定使用位置,避免依赖 Kotlin 的默认目标策略:
-| Kotlin 使用位置 | 逻辑声明 |
-| ------------ | ---------------------------------------------- |
-| `@field:` | 后备字段 |
-| `@get:` | getter |
-| `@set:` | setter |
-| `@param:` | 选定构造函数的参数 |
-| `@setparam:` | 支持参数注解的 setter 值参数 |
+| Kotlin 使用位置 | 逻辑声明 |
+| --------------- | ---------------------------- |
+| `@field:` | 后备字段 |
+| `@get:` | getter |
+| `@set:` | setter |
+| `@param:` | 选定构造函数的参数 |
+| `@setparam:` | 支持参数注解的 setter 值参数 |
不支持 `@property:`,因为 Fory JSON 注解不以 Kotlin 专有的属性元数据为目标。`@setparam:JsonProperty` 会被拒绝,因为 setter 参数命名不属于 JSON 属性名契约。`@setparam:JsonIgnore`、`@setparam:JsonCodec` 和 `@setparam:JsonUnwrapped` 作用于对应的单参数 setter 属性,也直接支持有效的 `@set:JsonCodec`。
@@ -96,7 +96,7 @@ Mixin 提供的 `JsonCodec` 会成为目标的有效注解。精确的 `register
## `JsonProperty`
-`JsonProperty` 配置一个完整逻辑属性的规范名称、序列化索引和 null 包含策略。字段、getter 或 setter
+`JsonProperty` 配置一个完整逻辑属性的规范名称、序列化索引和值包含策略。字段、getter 或 setter
上的注解会应用于合并后的字段/getter/setter 属性组。
```java
@@ -124,12 +124,15 @@ public final class User {
支持以下包含策略:
-- `DEFAULT`:使用 `ForyJsonBuilder.defaultPropertyInclusion`(初始值为 `NON_NULL`)。
+- `DEFAULT`:继承类上的 `JsonInclude`,再使用 `ForyJsonBuilder.defaultPropertyInclusion`(初始值为 `NON_NULL`)。
- `ALWAYS`:即使选中的值为 null,也写入该属性。
- `NON_NULL`:省略 null 值。
- `NON_EMPTY`:省略 null、长度为零的 `CharSequence`(包括字符串)和 Java 数组、
空的 `java.util.Collection` 和 `java.util.Map`,以及不含值的 JDK `Optional`、
`OptionalInt`、`OptionalLong` 和 `OptionalDouble`。
+ 安装 Scala 模块后,还会省略 `None` 以及受支持的空严格求值 Scala 集合和 Map。
+- `NON_DEFAULT`:显式授权在属性等于受支持的默认值时省略它。不同的值(包括 null 或空值)仍会保留。
+ 不支持的默认值来源会在模型初始化时失败。见[默认值省略](#jsoninclude-and-default-omission)。
```java
public final class Response {
@@ -138,9 +141,11 @@ public final class Response {
}
```
-当 `items` 是空列表时,该对象会写为 `{}`。属性上显式指定的包含策略优先于 builder 默认值。
-空值检查针对属性的逻辑值,在调用选定的编解码器之前执行。自定义编解码器将普通对象写为 `""`
-或 `{}`,并不会使该对象被视为空。空 `byte[]` 无论使用 Base64 还是数字数组表示,都属于空值。
+当 `items` 是空列表时,该对象会写为 `{}`。属性上显式指定的包含策略优先于类和 builder 默认值。
+Java 空值检查直接执行,即使该值使用自定义编解码器也是如此。其他类型使用选定编解码器的
+`isEmpty(writer, value)`,其默认返回 `false`。自定义编解码器需要重写该方法才能定义空值;
+仅写出 `""` 或 `{}` 并不会使普通对象被视为空。空 `byte[]` 使用 Base64、Base16 或数字数组表示时
+都属于空值。见[自定义空值](custom-codecs.md#custom-empty-values)。
过滤只检查当前属性值,不递归检查内部内容:`0`、`false`、含 null 的列表、含空列表的列表,
以及包含空列表的非空 Optional 都会保留。属性包含策略不会过滤根值、集合元素、Map 条目或
@@ -148,7 +153,7 @@ Any 条目。原始 JSON String 属性按字符串检查,不会解析其中的
Kotlin 属性遵循配置的包含策略,即使省略属性会因默认值而改变读取结果,或导致缺少必需属性的读取失败;
请参阅 [Kotlin 包含策略](kotlin.md#immutable-classes-and-compiler-defaults)。
-Scala 仍遵循[必需构造函数参数规则](scala.md#case-classes-and-annotations)。
+Scala 的字段缺失行为见 [case class 与注解](scala.md#case-classes-and-annotations)。
包含策略只影响写入。对于没有写入来源、仅供创建器使用的属性,非默认包含策略无效。可以重复相同声明;
同一逻辑属性中相互冲突的显式名称、索引或非默认包含策略会被拒绝。规范化为同一最终 JSON 名称的两个
@@ -161,6 +166,83 @@ Scala 仍遵循[必需构造函数参数规则](scala.md#case-classes-and-annota
不支持别名以及相互独立的读写名称。`JsonProperty` 不能与 Any 逻辑属性组合,
也不能声明在 `JsonAnySetter` 上。
+## `JsonInclude` 与默认值省略 {#jsoninclude-and-default-omission}
+
+默认值可能依赖构造函数参数、时间、随机数或外部状态。能够求值并不意味着省略后能恢复相同的值。
+因此,`NON_DEFAULT` 需要逐属性显式授权,或通过类注解批量授权:
+
+```java
+import org.apache.fory.json.annotation.JsonInclude;
+import org.apache.fory.json.annotation.JsonProperty;
+import org.apache.fory.json.annotation.JsonProperty.Include;
+
+@JsonInclude(Include.NON_DEFAULT)
+public final class Options {
+ public int retries = 3;
+ public String label = "default";
+ @JsonProperty(include = Include.ALWAYS)
+ public long timestamp;
+}
+```
+
+未修改的 `Options` 写为 `{"timestamp":0}`。若只授权 `retries`,移除 `JsonInclude`,并在该字段上
+添加 `@JsonProperty(include = Include.NON_DEFAULT)`。属性策略优先于类策略,类策略优先于 builder 默认值。
+类注解不被子类继承;类上的 `DEFAULT` 使用 builder 设置。
+
+类级授权也覆盖**未来新增的属性**。维护者必须确认每个新属性的默认值稳定、求值安全,并能在字段缺失时
+恢复一致的值,或通过 `ALWAYS` 排除该属性。`defaultPropertyInclusion(NON_DEFAULT)` 会立即抛出配置错误,
+避免全局授权将此契约静默应用于无关模型。`NON_EMPTY` 不授予默认值求值权限。
+
+| 模型 | 支持的默认值来源 |
+| ----------------------------------------------------------------------------------- | ------------------------------------------------------ |
+| Scala 构造函数属性 | 每次写入时,用实际的前置参数调用声明的编译器默认值方法 |
+| Java 普通无参模型 | 使用读取时选定的无参构造函数创建一个参考对象 |
+| 选定构造函数的所有参数都有默认值的 Kotlin 模型 | 使用这些语言默认值创建一个参考对象 |
+| Kotlin 普通无参模型 | 使用该构造函数创建一个参考对象 |
+| Java 必需构造函数参数、含必需参数的 Kotlin 构造函数,或缺少默认值/依赖的 Scala 属性 | 对已授权属性报错 |
+
+每份已初始化的模型元数据只构造一次参考对象,而非每次序列化都构造。声明类型与动态类型的模型使用位置
+可能分别初始化。授权允许执行**整个构造函数**、其他字段初始化器及 Kotlin `init` 块。
+没有 `NON_DEFAULT` 的模型不会创建参考对象。其他无参构造函数不能替换已选定的创建器。
+构造失败或访问已授权属性失败时会报告模型与属性,不会静默回退或绕过构造函数分配对象。
+
+调用方负责保证默认值稳定、比较求值没有外部可见副作用,以及字段缺失时能恢复相同的逻辑值。
+Fory 不证明纯度或分析默认值表达式。Scala 依赖式默认值方法在接收实际参数且读取能恢复同一上下文时可以安全使用。
+固定的 Java/Kotlin 参考对象无法表示随当前输入变化的默认值:对于 `low=1, high=low+1`,
+若在 `low=5` 的对象中省略 `high=2`,读取会得到 `high=6`。此时应通过 `ALWAYS` 保留 `high`。
+
+基本类型按值比较。浮点数区分正零和负零,非有限值保留并按常规方式输出。数组比较精确的数组类型与内容,
+嵌套数组递归比较;其他引用使用 `equals`。不支持循环结构的深度比较。
+读取行为独立:显式 null 不等于缺失,可变参考默认值不会与解码对象共享。
+
+可以通过已有 Mixin 机制授权默认值,而不修改模型:
+
+```java
+import org.apache.fory.json.ForyJson;
+import org.apache.fory.json.annotation.JsonMixin;
+import org.apache.fory.json.annotation.JsonProperty;
+import org.apache.fory.json.annotation.JsonProperty.Include;
+
+final class RetryPolicy {
+ public int retries = 3;
+ public long timestamp;
+}
+
+@JsonMixin(target = RetryPolicy.class)
+abstract class RetryPolicyMixin {
+ @JsonProperty(include = Include.NON_DEFAULT)
+ int retries;
+}
+
+// A class-level @JsonInclude on a Mixin can also supply the target's class policy.
+var json = ForyJson.builder().registerMixin(RetryPolicyMixin.class).build();
+json.toJson(new RetryPolicy()); // {"timestamp":0}
+```
+
+Android 和 Native Image 继续使用已有的 `@JsonType` 或 Mixin 构建配置。
+使用 R8/ProGuard 的 Kotlin 应用必须运行 JSON KSP。默认值在运行时求值,不在注解处理阶段求值。
+见 [Kotlin](kotlin.md)。
+
## `JsonPropertyOrder`
`JsonPropertyOrder` 将具名序列化前缀、属性索引和按最终名称的字母顺序排序结合起来:
@@ -328,8 +410,8 @@ Map 值。它不能放在 setter、创建器参数或 Any 声明上,也不能
## `JsonByteArray`
-未标注的 `byte[]` 值使用带引号的标准 Base64 JSON 字符串。`JsonByteArray` 为一个精确的 `byte[]`
-字段或 getter 选择 `BASE64` 或 `ARRAY` 表示,并同时作用于读写:
+`JsonByteArray` 为一个精确的 `byte[]` 字段或 getter 选择 `BASE64`、`BASE16` 或 `ARRAY` 表示,
+并同时作用于读写。它覆盖 builder 的 `byteArrayFormat`,后者默认为 `BASE64`:
```java
import org.apache.fory.json.annotation.JsonByteArray;
@@ -340,23 +422,51 @@ public final class Attachment {
@JsonByteArray(JsonByteArray.Format.BASE64)
public byte[] content;
+
+ @JsonByteArray(JsonByteArray.Format.BASE16)
+ public byte[] hex;
}
```
-对于字节 `{1, -2, 3}`,`numbers` 写为 `[1,-2,3]`,`content` 写为 `"Af4D"`。`ARRAY` 按有符号
+对于字节 `{1, -2, 3}`,`numbers` 写为 `[1,-2,3]`,`content` 写为 `"Af4D"`,`hex` 写为 `"01fe03"`。
+`BASE16` 写入不带前缀或分隔符的小写十六进制字符,读取接受大小写字符及 JSON 字符串转义,
+拒绝奇数长度或无效的十六进制字符串。`ARRAY` 按有符号
字节范围 `[-128, 127]` 读取 JSON 数组;`BASE64` 读取标准 Base64 字符串,并在写入时保留填充符。
-两种表示都接受 JSON null,null 输出遵循属性的常规包含规则。默认 Base64 编解码器不接受数字数组
+三种表示都接受 JSON null,null 输出遵循属性的常规包含规则。默认 Base64 编解码器不接受数字数组
输入;使用该格式的属性应选择 `ARRAY`。
使用该注解时必须指定格式。它只作用于被标注的字节数组属性,不作用于容器元素或 Map 值。Mixin
声明可以选择或移除该注解。它不能与 `JsonRawValue`、声明位置上的 `JsonCodec`、`JsonFormat` 或 Any
声明共用于同一逻辑属性。同一属性的字段和 getter 选择冲突格式时会被拒绝。
-Base64 值是二进制叶值,不计入对象图内存配额;数字数组则会将其数组存储计入该配额。详见
+Base64 和 Base16 值是二进制叶值,不计入对象图内存配额;数字数组则会将其数组存储计入该配额。详见
[安全](security.md#depth-and-graph-memory-limits)。
## `JsonFormat`
+在 Boolean 或数值属性上使用 `@JsonFormat(shape = JsonFormat.Shape.STRING)`,可将其 JSON token
+文本写入引号内,例如将 `false` 写为 `"false"`、`7` 写为 `"7"`。它也适用于匹配的创建器或 setter
+参数,包括 Scala 构造函数属性;还可通过 Mixin 配置而不修改模型:
+
+```java
+import org.apache.fory.json.annotation.JsonFormat;
+
+public class Metrics {
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ public boolean active;
+
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ public long count;
+}
+```
+
+读取同时接受带引号和原生 token,遵循声明标量类型的常规范围与 null 规则。
+null 引用仍为 JSON `null`,并遵循属性包含策略。支持 Boolean、基本/装箱数值类型、
+`BigInteger`、`BigDecimal`,以及 Scala 模块的 `BigInt`/`BigDecimal`。
+非有限浮点值保留原有字符串表示(`"NaN"`、`"Infinity"` 或 `"-Infinity"`)。
+字符串形态不能与 pattern、timezone 或自定义值表示组合。
+下方的直接包装规则也适用于标量字符串形态;它不会递归地将任意对象转为字符串,也不改变 Map 键。
+
在日期/时间字段上使用 `JsonFormat`,可为读写两个方向选择 JSON 文本格式。格式采用
`DateTimeFormatter` 语法和根语言环境:
@@ -403,7 +513,7 @@ public final class Schedule {
如果必须在夏令时重叠期间保留精确时刻,请在格式中包含偏移量。省略 `timezone` 时保留上述默认行为。
无效的时区标识符,以及在其他受支持日期/时间类型上使用非空 `timezone`,都会被拒绝。
-`JsonFormat` 是字段注解,而不是类型使用注解。Record 组件通过其生成字段生效。嵌套包装、Map 键、
+`JsonFormat` 通过字段、创建器参数或 setter 参数配置逻辑属性,而不是类型使用注解。支持 Record 组件。嵌套包装、Map 键、
原始类型或通配符直接子元素、JSON Any 值以及展开值会被有意拒绝。不支持格式化语义模糊的类型,包括
旧版和 SQL 日期类型、`Duration`、`Period`、`TimeZone`、`ZoneId` 和 `ZoneOffset`。具有完整注册表示、
注解选择表示、多态表示或 `JsonValue` 表示的包装类型也会被拒绝,因为这些表示方式拥有整个包装对象。
@@ -448,8 +558,10 @@ Any 处理。
Fory 会拒绝重复的最终名称、仅由展开属性构成的递归链、参数化子对象、JSON Any 子对象、多态或自定义
编解码器子对象根,以及标量、数组、集合或 Map 子对象。若要展开 Map,请使用 `JsonAnyProperty`、
-`JsonAnyGetter` 或 `JsonAnySetter`。展开属性不能使用 `JsonProperty.value`、非默认的
-`JsonProperty.include`、`JsonCodec` 和 `JsonFormat`;普通子叶属性仍可使用这些配置。
+`JsonAnyGetter` 或 `JsonAnySetter`。展开组可以用 `NON_DEFAULT` 在匹配已授权默认值时省略整个组,
+或用 `ALWAYS` 排除类级默认值策略;各子属性仍按自身策略决定是否输出。
+展开属性不支持其他显式组包含策略、`JsonProperty.value`、`JsonCodec` 和 `JsonFormat`;
+普通子叶属性仍可使用这些配置。
## 动态对象成员
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/custom-codecs.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/custom-codecs.md
index 2084dc30b1c..620dc6445dd 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/custom-codecs.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/custom-codecs.md
@@ -24,6 +24,10 @@ Fory 的 String 或 UTF-8 写入器,并直接从 Fory 的 Latin-1、UTF-16 或
它不是 JSON 抽象语法树(AST)或 `JsonNode` 编解码器。它负责处理包含 JSON null 在内的完整值,
但绝不处理 Map 键;JSON 对象成员名称仍由 `MapKeyCodec` 负责。
+使用 `writeString`、`writeChar`、`writeFieldName` 或 writer 的转义追加方法,
+以遵循实例的 `escapeNonAscii` 设置。直接写入原始内容会保留传入内容;
+输出原始 token 的自定义编解码器应自行负责转义。见[非 ASCII 转义](object-mapping.md#non-ascii-escaping)。
+
如果应用编解码器在每种表示形式下都采用相同语义,请继承 `AbstractJsonValueCodec<T>`,
只需实现一次 JSON 结构:
@@ -102,8 +106,8 @@ ForyJson json =
仅当工厂在动态写入期间为值的实际类选择编解码器时,`runtimeType` 才为 `true`;声明的根类型和复合子类型收到的是 `false`。复合编解码器如果在构造后仍需此区分,必须保留该标志供后续 `resolveTypes` 调用使用,不能从 resolver 状态推断。
外层属性仍控制其名称、忽略方向和包含策略。如果属性被 `NON_NULL` 或 `NON_EMPTY` 省略,
-就不会调用值编解码器。`NON_EMPTY` 检查属性的逻辑值,因此即使使用自定义 List 编解码器,
-空 List 仍被视为空。普通应用对象不会因为其编解码器输出的 JSON 内容而被视为空。
+就不会调用编解码器的写入操作。`NON_EMPTY` 直接检查 Java 空值类型,
+其他类型使用编解码器的 `isEmpty` 方法;见[自定义空值](#custom-empty-values)。
如果属性会被输出,或者该值是数组元素、集合元素、Map 值、Optional 值或原子引用值,
编解码器就会接收并负责处理 null。注册的实例会在并发操作之间共享,因此必须是线程安全的。
@@ -116,6 +120,29 @@ Fory JSON 不会使用目标类型的 `JsonValidator` 方法来包装完整的
为 `JsonSubTypes` 基类注册自定义编解码器,会取代该基类的子类型注解。对于列出的子类型,
两种包装器包含方式支持注册自定义编解码器,但内联属性包含方式不支持。
+## 自定义空值 {#custom-empty-values}
+
+对于内置 Java 空值类型之外的非 null 值,`NON_EMPTY` 调用选定编解码器的
+`isEmpty(JsonWriter writer, T value)`。默认返回 `false`。如果类型有空状态,可重写它:
+
+```java
+// Inside MoneyCodec: treat a missing amount as an empty Money value.
+@Override
+public boolean isEmpty(JsonWriter writer, Money value) {
+ return value.amount == null;
+}
+```
+
+通过属性上的 `@JsonProperty(include = JsonProperty.Include.NON_EMPTY)`、
+类上的 `@JsonInclude(JsonProperty.Include.NON_EMPTY)` 或
+`defaultPropertyInclusion(JsonProperty.Include.NON_EMPTY)` 启用省略。
+该方法不能写入输出;writer 参数为动态编解码器提供当前操作的上下文。
+
+字符串和其他 Java `CharSequence`、数组、Java 集合/Map 及 JDK Optional 使用直接空值检查,
+不调用自定义 `isEmpty`。检查针对原始值,与编解码器的表示方式无关。
+对于其他类型(包括 Scala Option 和集合),替换内置编解码器也会替换其空值行为。
+根值、容器元素及非空包装器的内容不会被递归过滤。
+
## 使用 `JsonCodec` 选择编解码器
在类、record、枚举或接口上使用 `@JsonCodec`,可声明其默认的完整值编解码器。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/getting-started.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/getting-started.md
index 707349a37fb..83f68cc667b 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/getting-started.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/getting-started.md
@@ -41,7 +41,7 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-json</artifactId>
- <version>1.7.4</version>
+ <version>1.7.5</version>
</dependency>
```
@@ -55,7 +55,7 @@ repositories {
mavenCentral()
}
-implementation("org.apache.fory:fory-json:1.7.4")
+implementation("org.apache.fory:fory-json:1.7.5")
```
### Kotlin
@@ -64,7 +64,7 @@ Kotlin/JVM 应用添加可选的 Kotlin JSON 运行时,并使用其统一 buil
```kotlin title="build.gradle.kts"
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.4")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.5")
}
```
@@ -145,14 +145,14 @@ public final class JsonExample {
Fory JSON 支持 String 输入/输出、UTF-8 字节输入/输出,以及通过 `ByteBuffer` 分块提供的增量 UTF-8 输入。目前不提供阻塞式 `InputStream` 解析 API。
-| 操作 | 运行时类型 | 声明的 `Class` | 声明的 `TypeRef` |
-| -------------------- | ------------------------- | ---------------------------- | ------------------------------ |
-| String 输出 | `toJson(value)` | `toJson(value, type)` | `toJson(value, typeRef)` |
-| UTF-8 字节 | `toJsonBytes(value)` | `toJsonBytes(value, type)` | `toJsonBytes(value, typeRef)` |
-| UTF-8 `OutputStream` | `writeJsonTo(value, out)` | `writeJsonTo(value, type, out)` | `writeJsonTo(value, typeRef, out)` |
-| String 输入 | - | `fromJson(text, type)` | `fromJson(text, typeRef)` |
-| UTF-8 输入 | - | `fromJson(bytes, type)` | `fromJson(bytes, typeRef)` |
-| UTF-8 字节范围 | - | `fromJson(bytes, offset, length, type)` | `fromJson(bytes, offset, length, typeRef)` |
+| 操作 | 运行时类型 | 声明的 `Class` | 声明的 `TypeRef` |
+| -------------------- | ------------------------- | --------------------------------------- | ------------------------------------------ |
+| String 输出 | `toJson(value)` | `toJson(value, type)` | `toJson(value, typeRef)` |
+| UTF-8 字节 | `toJsonBytes(value)` | `toJsonBytes(value, type)` | `toJsonBytes(value, typeRef)` |
+| UTF-8 `OutputStream` | `writeJsonTo(value, out)` | `writeJsonTo(value, type, out)` | `writeJsonTo(value, typeRef, out)` |
+| String 输入 | - | `fromJson(text, type)` | `fromJson(text, typeRef)` |
+| UTF-8 输入 | - | `fromJson(bytes, type)` | `fromJson(bytes, typeRef)` |
+| UTF-8 字节范围 | - | `fromJson(bytes, offset, length, type)` | `fromJson(bytes, offset, length, typeRef)` |
每次 `fromJson` 调用恰好消费一个 JSON 值,并拒绝其后的非空白内容。字节范围重载只解析指定范围,忽略范围之前和之后的字节。返回的 String 和字节数组与内部可复用缓冲区相互独立。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/graalvm.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/graalvm.md
index e76f9b7ff3c..c58044ad616 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/graalvm.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/graalvm.md
@@ -150,7 +150,14 @@ public class JsonExample {
支持在类型、字段、有效的普通 getter、setter 值参数和 `JsonCreator` 参数上使用 `@JsonCodec` 注解。Feature 会保留每个选定的完整值、元素、内容、Map 键和 Map 值 Codec 的构造函数。这与 JVM 和 Android 使用的注解模型相同。
-支持 `JsonValue` 字段和有效的 public 无参数方法,包括匹配的单 String `JsonCreator` 构造函数和 public static factory。固定的 `JsonRawValue` 字段和 getter 支持可信的原始 String 值;`JsonByteArray` 字段和 getter 与 JVM 上一样选择 Base64 字符串或数字字节数组。`JsonFormat` 日期/时间字段使用与 JVM 相同的直接字段、单层包装和 `timezone` 行为。对于直接放在目标类上的注解,请使用 `JsonType` 标注每个可达的所属模型,以便 Native Image 保留这些成员和所选字节数组编解码器的构造函数。
+支持 `JsonValue` 字段和有效的 public 无参数方法,包括匹配的单 String `JsonCreator` 构造函数和 public static factory。
+固定的 `JsonRawValue` 字段和 getter 支持可信的原始 String 值;`JsonByteArray` 字段和 getter 与 JVM 上一样
+选择 Base64 字符串、Base16 字符串或数字字节数组。builder 的 `byteArrayFormat` 控制默认表示;
+使用生成的对象编解码器时,应在 provider 中包含该设置。`escapeNonAscii(true)` 对字符串值和名称的作用
+与 JVM 相同,使用生成的对象编解码器时也应在 provider 中配置。原始 JSON 保持原样。
+`JsonFormat` 日期/时间字段使用与 JVM 相同的直接字段、单层包装和 `timezone` 行为。
+对于直接放在目标类上的注解,请使用 `JsonType` 标注每个可达的所属模型,
+以便 Native Image 保留这些成员和所选字节数组编解码器的构造函数。
直接标注的 `JsonValue` Record 会使用生成的 component accessor 和 canonical constructor 操作。由 Mixin 提供的有效声明则使用上述 Mixin 工作流。
`JsonAnyProperty` 和 `JsonAnyGetter` 会将其 Map 展平到外层对象中。可以在该字段或 getter 上使用 `@JsonCodec(valueCodec = ...)` 来定制每个动态值。`JsonAnySetter` 的第二个参数可以对自身的值结构使用常规配置。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/kotlin.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/kotlin.md
index a6b3f221006..671eb4be2e6 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/kotlin.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/kotlin.md
@@ -38,7 +38,7 @@ repositories {
}
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.4")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.5")
}
```
@@ -50,7 +50,7 @@ plugins {
}
dependencies {
- ksp("org.apache.fory:fory-json-kotlin-ksp:1.7.4")
+ ksp("org.apache.fory:fory-json-kotlin-ksp:1.7.5")
}
```
@@ -77,11 +77,32 @@ val text = json.toJson(Account(7u, "Alice"), accountType)
val decoded = json.fromJson(text, accountType)
```
+使用 `ForyJsonKotlin.builder().escapeNonAscii(true)` 可以在紧凑和格式化输出中转义非 ASCII 字符串内容与名称。
+该设置在实例构建后固定;原始 JSON 保持原样。见[非 ASCII 转义](object-mapping.md#non-ascii-escaping)。
+
当有符号 `Long` 和无符号 `ULong` 值需要以带引号的十进制字符串输出时,请使用
`ForyJsonKotlin.builder().writeLongAsString(true)`。该设置还适用于声明的 collection 和 Map 值、
可空值、以这些类型为底层值的 Kotlin 值类、`ULongArray`,以及核心 JSON 运行时支持的 Java Long
类包装器。Reader 同时接受带引号和不带引号的整数 token。
+`ByteArray` 默认使用 Base64 字符串。标准 builder 的 `byteArrayFormat` 也控制根数组,
+以及嵌套在属性、集合和 Map 中的数组:
+
+```kotlin
+import org.apache.fory.json.annotation.JsonByteArray
+import org.apache.fory.json.kotlin.ForyJsonKotlin
+import org.apache.fory.json.kotlin.jsonTypeRef
+
+val hexJson = ForyJsonKotlin.builder().byteArrayFormat(JsonByteArray.Format.BASE16).build()
+val bytesType = jsonTypeRef<ByteArray>()
+val text = hexJson.toJson(byteArrayOf(1, -2, 3), bytesType) // "\"01fe03\""
+val bytes = hexJson.fromJson(text, bytesType)
+```
+
+`@field:JsonByteArray` 或 `@get:JsonByteArray`(包括 Mixin 声明)可以覆盖该属性的默认格式。
+`UByteArray` 保留无符号数字数组表示。可接受的输入和 null 行为见
+[字节数组格式](object-mapping.md#builder-configuration)。
+
`jsonTypeRef<T>()` 是类型令牌,不是编解码器查找操作。应创建一次并复用。Java `Class` 或普通 Java `TypeRef` 无法表达 `List<Account?>`、`UInt` 或降低为基本类型载体的逻辑值类等区别。
也可以通过 builder 显式安装模块:
@@ -117,7 +138,7 @@ data class Request(
- `{"id":1}` 会调用两个编译器默认值。
- `{"id":1,"label":null}` 会传入显式 null,不调用 `label` 的默认值。
-- 缺少 `id` 会在调用构造函数前失败。
+- 缺少 `id` 使用 `0`。
- `{"id":1,"retries":null}` 会失败;null 不会要求 Kotlin 使用默认值。
普通类体 `var` 属性在成员缺失时保留初始化值,在成员存在时于构造后赋值。`lateinit` 属性是必需的。自动 creator 属性和延后赋值属性都必须能在读写两个方向重建。
@@ -126,7 +147,7 @@ data class Request(
Kotlin 的构造函数参数和类体属性都遵循配置的[属性包含策略](annotations.md#jsonproperty)。
默认的 `NON_NULL` 省略 null,`NON_EMPTY` 还会省略空字符串、数组、集合、Map 和不含值的 JDK Optional。
-属性上的 `@JsonProperty(include = ...)` 优先于 builder 默认值。使用 `ALWAYS` 或
+属性上的 `@JsonProperty(include = ...)` 优先于类上的 `@JsonInclude` 策略,后者优先于 builder 默认值。使用 `ALWAYS` 或
`writeNullFields(true)` 可以保留 null。
```kotlin
@@ -144,10 +165,54 @@ val text = json.toJson(Response(1, items = emptyList())) // {"id":1}
```
包含策略只影响写入。读取示例输出时,`items` 使用声明的默认值 null,因此不会保留原来的空列表。
-缺失的构造函数参数使用声明的默认值;如果没有默认值则读取失败。缺失的类体属性保留初始化值。
+缺失的构造函数参数优先使用声明的默认值;否则,非空数值和 Boolean 参数使用零和 `false`,
+可空参数使用 `null`,其他非空参数仍为必需参数。缺失的类体属性保留初始化值。
显式 null 与字段缺失不同,非空属性仍会拒绝显式 null。如果需要精确往返,应选择能保留所需值的包含策略。
-序列化时不会比较 Kotlin 默认值,也不会执行初始化器。无论默认值为 null、`emptyList()` 还是非空列表,
+`NON_DEFAULT` 需要通过属性上的 `@JsonProperty` 或类上的 `@JsonInclude` 显式授权。
+只有**选定构造函数的每个参数都有语言默认值**,或模型使用普通无参构造函数时才支持。
+Fory 为每份已初始化的模型元数据构造一个参考对象并获取已授权属性的值,执行完整构造函数、
+所有初始化器和 `init` 块。此操作不会在每次写入时重复;未授权的模型不会构造参考对象。
+动态类型和声明类型的模型使用位置可能分别初始化。
+
+包含必需参数的模型会被拒绝,即使另一个构造函数恰好没有参数。Fory 不会伪造参数、
+借用第一个对象的参数、更改创建器选择、绕过构造函数或分析字节码。构造失败会报告模型和属性。
+全局 `defaultPropertyInclusion(NON_DEFAULT)` 会被拒绝。
+
+Kotlin 元数据只表明默认值是否存在,不揭示表达式或依赖关系。调用方必须确认默认值稳定、
+参考对象构造没有外部可见副作用,以及字段缺失时能恢复一致的值。
+固定参考对象无法表示依赖当前输入、时间、随机数或外部状态的默认值,应排除这些属性:
+
+```kotlin
+import org.apache.fory.json.annotation.JsonInclude
+import org.apache.fory.json.annotation.JsonProperty
+import org.apache.fory.json.annotation.JsonProperty.Include
+import org.apache.fory.json.kotlin.ForyJsonKotlin
+
+@JsonInclude(Include.NON_DEFAULT)
+data class Limits(
+ val low: Int = 1,
+ @param:JsonProperty(include = Include.ALWAYS) val high: Int = low + 1
+)
+
+val json = ForyJsonKotlin.builder().build()
+json.toJson(Limits()) // {"high":2}
+json.toJson(Limits(5, 2)) // {"low":5,"high":2}
+json.fromJson("""{"low":5}""", Limits::class.java) // Limits(5, 6)
+```
+
+当 `low=5` 时必须保留 `high=2`,否则会恢复为 `high=6`。参数依赖并非一概不安全,
+但固定参考对象无法提供其变化的上下文。若只授权个别属性,移除 `JsonInclude`,
+并在对应属性上添加 `@param:JsonProperty(include = Include.NON_DEFAULT)`。
+已注册的 Mixin 可以提供类或属性策略,无需修改模型。类级授权也覆盖未来新增的属性;
+维护者必须校验每个新增默认值,或通过 `ALWAYS` 排除。
+
+读取缺失字段时仍调用正常的 Kotlin 默认值。显式 null 不等于缺失。参考对象及其可变集合不会与
+解码对象共享。比较使用基本类型值、引用的 `equals` 契约及数组内容,见
+[默认值省略](annotations.md#jsoninclude-and-default-omission)。代码压缩时使用已有 JSON KSP 配置;
+默认值在运行时求值,不在 KSP 处理期间求值。
+
+无论默认值为 null、`emptyList()` 还是非空列表,
`NON_EMPTY` 都会省略空列表。非空值类不会因为底层字符串或集合为空而被当作空属性。
对于本身实现 `CharSequence`、`Collection` 或 `Map` 的未装箱值类,不支持显式的 `NON_EMPTY`;
这类模型应使用包含它的对象的自定义编解码器。
@@ -156,12 +221,15 @@ val text = json.toJson(Response(1, items = emptyList())) // {"id":1}
Kotlin 类型使用位置的可空性在根值、属性、容器元素、Map 值和泛型子类型上均会被检查:
-| 声明 | 成员缺失 | 显式 JSON `null` |
-| --------------------------------- | --------------------- | ---------- |
-| `val value: String` | 失败 | 失败 |
-| `val value: String?` | 失败 | 传入 null |
-| `val value: String = expression` | 求值默认值 | 失败 |
-| `val value: String? = expression` | 求值默认值 | 传入 null |
+| 声明 | 成员缺失 | 显式 JSON `null` |
+| --------------------------------- | ------------ | ---------------- |
+| `val value: String` | 失败 | 失败 |
+| `val value: String?` | 传入 null | 传入 null |
+| `val value: Int` | 使用 `0` | 失败 |
+| `val value: Boolean` | 使用 `false` | 失败 |
+| `val value: Int?` | 传入 null | 传入 null |
+| `val value: String = expression` | 求值默认值 | 失败 |
+| `val value: String? = expression` | 求值默认值 | 传入 null |
`List<String?>` 接受 null 元素,`List<String>` 拒绝 null 元素。Map 键必须非空。自动构造 Kotlin 模型时,不会猜测平台类型或未知的可空性。
@@ -240,56 +308,56 @@ Fory 执行经过验证的编译器构造操作,因此值类初始化检查仍
从 Kotlin 使用 Java/JDK 标量、时间类型、Optional、原子类型、数组、集合、Map、枚举和 JSON 树类型时,它们保持常规 Fory JSON 表示:
-| 核心类型类别 | Kotlin 中的行为 |
-| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| `Any` / `Any?` | 自然 JSON Boolean、数字、String、数组、对象或 null;写入时按运行时类型动态分派 |
-| 有符号标量及装箱类型 | `Boolean`、`Byte`、`Short`、`Int`、`Long`、`Float`、`Double`、`Char` 和 `Number` 使用核心标量编解码器;非有限浮点值使用核心的带引号表示 |
-| 文本 | `String`、精确 `CharSequence`、`StringBuilder` 和 `StringBuffer` 使用字符串表示 |
-| 任意精度/低精度数值 | `BigInteger`、`BigDecimal`、Fory `Float16` 和 `BFloat16` 使用核心数值表示与限制 |
-| 枚举 | 带引号的枚举常量名 |
-| Java/Kotlin 数组 | 除 `ByteArray` 默认使用 Base64 字符串外,均为普通 JSON 数组;`@field:JsonByteArray(JsonByteArray.Format.ARRAY)` 可选择数字数组;无符号语义数组见下文 |
-| Optional 与原子类 | `Optional<T>`、基本类型 Optional、原子标量/引用和原子数组保持核心透明表示,并受上述可空性规则约束 |
-| 带引号的 JDK 值 | `Currency`、`File`、`URI`、`Path`、`Pattern`、`UUID`、`Locale`、`Charset` 和 `TimeZone` 保持核心字符串表示 |
-| 旧版日期/时间 | `Date`、`Calendar` 及可用的 `java.sql.Date`、`Time` 和 `Timestamp` 保持自 Unix 纪元起的毫秒数表示 |
-| Java 时间类型 | `LocalDate`、`LocalTime`、`LocalDateTime`、`Instant`、`java.time.Duration`、`ZoneOffset`、`ZoneId`、`ZonedDateTime`、`Year`、`YearMonth`、`MonthDay`、`Period`、`OffsetTime`、`OffsetDateTime` 和受支持的历法日期保持核心精确文本语法 |
-| 其他核心值 | `BitSet`、`ByteBuffer`、`JsonArray` 和 `JsonObject` 保持常规核心表示 |
-| 集合/Map | 受支持的 Java/Kotlin `Collection`、`Map` 接口和实现使用核心数组/对象表示;受支持的 Guava 不可变载体仍为可选依赖 |
-| Map 键 | String、枚举、有符号 `Byte`/`Short`/`Int`/`Long`,以及下文补充的 Kotlin 无符号类型/值类;Boolean、浮点、可空和任意对象键需要显式键编解码器或完整 Map 编解码器 |
-| 固定拒绝的类型 | 仍拒绝 `Class`、URL/网络/socket/地址类型、不支持的 JDK 内部集合实现,以及未注册的 `Number`/`CharSequence` 子类;应用可在常规类型和安全检查允许的范围内显式定义自有表示 |
+| 核心类型类别 | Kotlin 中的行为 |
+| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `Any` / `Any?` | 自然 JSON Boolean、数字、String、数组、对象或 null;写入时按运行时类型动态分派 |
+| 有符号标量及装箱类型 | `Boolean`、`Byte`、`Short`、`Int`、`Long`、`Float`、`Double`、`Char` 和 `Number` 使用核心标量编解码器;非有限浮点值使用核心的带引号表示 |
+| 文本 | `String`、精确 `CharSequence`、`StringBuilder` 和 `StringBuffer` 使用字符串表示 |
+| 任意精度/低精度数值 | `BigInteger`、`BigDecimal`、Fory `Float16` 和 `BFloat16` 使用核心数值表示与限制 |
+| 枚举 | 带引号的枚举常量名 |
+| Java/Kotlin 数组 | 除 `ByteArray` 默认使用 Base64 字符串外,均为普通 JSON 数组;`@field:JsonByteArray(JsonByteArray.Format.ARRAY)` 可选择数字数组;无符号语义数组见下文 |
+| Optional 与原子类 | `Optional<T>`、基本类型 Optional、原子标量/引用和原子数组保持核心透明表示,并受上述可空性规则约束 |
+| 带引号的 JDK 值 | `Currency`、`File`、`URI`、`Path`、`Pattern`、`UUID`、`Locale`、`Charset` 和 `TimeZone` 保持核心字符串表示 |
+| 旧版日期/时间 | `Date`、`Calendar` 及可用的 `java.sql.Date`、`Time` 和 `Timestamp` 保持自 Unix 纪元起的毫秒数表示 |
+| Java 时间类型 | `LocalDate`、`LocalTime`、`LocalDateTime`、`Instant`、`java.time.Duration`、`ZoneOffset`、`ZoneId`、`ZonedDateTime`、`Year`、`YearMonth`、`MonthDay`、`Period`、`OffsetTime`、`OffsetDateTime` 和受支持的历法日期保持核心精确文本语法 |
+| 其他核心值 | `BitSet`、`ByteBuffer`、`JsonArray` 和 `JsonObject` 保持常规核心表示 |
+| 集合/Map | 受支持的 Java/Kotlin `Collection`、`Map` 接口和实现使用核心数组/对象表示;受支持的 Guava 不可变载体仍为可选依赖 |
+| Map 键 | String、枚举、有符号 `Byte`/`Short`/`Int`/`Long`,以及下文补充的 Kotlin 无符号类型/值类;Boolean、浮点、可空和任意对象键需要显式键编解码器或完整 Map 编解码器 |
+| 固定拒绝的类型 | 仍拒绝 `Class`、URL/网络/socket/地址类型、不支持的 JDK 内部集合实现,以及未注册的 `Number`/`CharSequence` 子类;应用可在常规类型和安全检查允许的范围内显式定义自有表示 |
核心表示详情见[对象映射](object-mapping.md#supported-java-types)。Kotlin 特有行为如下:
-| 类型类别 | 自动 JSON 表示或处理方式 |
-| ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
-| 普通类、data class 和嵌套类 | 具有命名属性的 JSON 对象 |
-| `inner` 类、普通抽象类/接口 | 仅支持封闭的 `JsonSubTypes` 或精确自定义编解码器 |
-| sealed 类/接口 | 推导或显式声明的封闭 `JsonSubTypes` 表 |
-| 枚举 | 带引号的枚举名 |
-| 无状态 `object`、`data object`、`Unit` | 严格的 `{}` |
-| 有状态对象、伴生对象 | 仅支持精确自定义编解码器 |
-| 值类 | 透明的底层值;需要精确绑定 |
-| `Nothing?` / `Nothing` | 仅允许 null / 拒绝 |
-| `Pair`、`Triple` | 具有 `first`、`second` 和 `third` 命名属性的对象 |
-| `Result`、`Lazy`、Kotlin 标准属性委托 | 仅支持精确自定义编解码器 |
-| 有符号基本类型、基本类型数组、`Array<T>` | 常规核心数字/Boolean/字符与数组表示 |
-| `UByte`、`UShort`、`UInt`、`ULong` 及其数组 | 无符号十进制数字和数组 |
-| 只读与可变集合/Map、Kotlin `ArrayDeque` | 常规核心数组/Map |
-| `Map.Entry`、私有集合载体、`Iterable`、`Sequence`、迭代器、`EnumEntries` | 自动映射时拒绝 |
-| `CharRange`、有符号/无符号整数区间 | `{"start":...,"endInclusive":...}` |
-| 对应的步进序列 | `{"first":...,"last":...,"step":...}` |
-| `ClosedRange`、`OpenEndRange`、抽象/开放/浮点区间 | 自动映射时拒绝 |
-| `kotlin.time.Duration` | 带引号的规范 Kotlin ISO 时长 |
-| `kotlin.time.Instant` | 带引号的规范 Kotlin ISO 时刻 |
-| `TimedValue<T>` | `{"value":...,"duration":...}` |
-| `DurationUnit`、`RegexOption` | 带引号的枚举名 |
-| 时钟、时间源/时间标记、Regex/匹配状态、Random | 仅支持精确自定义编解码器 |
-| `kotlin.uuid.Uuid` | 带引号的规范连字符 UUID |
-| 完整泛型类 / 声明处型变 | 精确替换后的 Schema |
-| `out X` / `in X` / 星投影 | 仅允许精确 final 或封闭的 `X` / 拒绝 / 拒绝 |
-| 递归泛型 | 仅允许相同的精确递归绑定;正在处理时展开到另一绑定会被拒绝 |
-| 类型别名 | 完全展开后的类型 |
-| 函数/挂起函数、反射类型、协程/flow/channel 状态 | 拒绝 |
-| 符合条件的第三方不可变 Kotlin 模型 | 在 JVM 上自动映射;应用注解覆盖时需注册精确 Mixin |
+| 类型类别 | 自动 JSON 表示或处理方式 |
+| ------------------------------------------------------------------------ | ---------------------------------------------------------- |
+| 普通类、data class 和嵌套类 | 具有命名属性的 JSON 对象 |
+| `inner` 类、普通抽象类/接口 | 仅支持封闭的 `JsonSubTypes` 或精确自定义编解码器 |
+| sealed 类/接口 | 推导或显式声明的封闭 `JsonSubTypes` 表 |
+| 枚举 | 带引号的枚举名 |
+| 无状态 `object`、`data object`、`Unit` | 严格的 `{}` |
+| 有状态对象、伴生对象 | 仅支持精确自定义编解码器 |
+| 值类 | 透明的底层值;需要精确绑定 |
+| `Nothing?` / `Nothing` | 仅允许 null / 拒绝 |
+| `Pair`、`Triple` | 具有 `first`、`second` 和 `third` 命名属性的对象 |
+| `Result`、`Lazy`、Kotlin 标准属性委托 | 仅支持精确自定义编解码器 |
+| 有符号基本类型、基本类型数组、`Array<T>` | 常规核心数字/Boolean/字符与数组表示 |
+| `UByte`、`UShort`、`UInt`、`ULong` 及其数组 | 无符号十进制数字和数组 |
+| 只读与可变集合/Map、Kotlin `ArrayDeque` | 常规核心数组/Map |
+| `Map.Entry`、私有集合载体、`Iterable`、`Sequence`、迭代器、`EnumEntries` | 自动映射时拒绝 |
+| `CharRange`、有符号/无符号整数区间 | `{"start":...,"endInclusive":...}` |
+| 对应的步进序列 | `{"first":...,"last":...,"step":...}` |
+| `ClosedRange`、`OpenEndRange`、抽象/开放/浮点区间 | 自动映射时拒绝 |
+| `kotlin.time.Duration` | 带引号的规范 Kotlin ISO 时长 |
+| `kotlin.time.Instant` | 带引号的规范 Kotlin ISO 时刻 |
+| `TimedValue<T>` | `{"value":...,"duration":...}` |
+| `DurationUnit`、`RegexOption` | 带引号的枚举名 |
+| 时钟、时间源/时间标记、Regex/匹配状态、Random | 仅支持精确自定义编解码器 |
+| `kotlin.uuid.Uuid` | 带引号的规范连字符 UUID |
+| 完整泛型类 / 声明处型变 | 精确替换后的 Schema |
+| `out X` / `in X` / 星投影 | 仅允许精确 final 或封闭的 `X` / 拒绝 / 拒绝 |
+| 递归泛型 | 仅允许相同的精确递归绑定;正在处理时展开到另一绑定会被拒绝 |
+| 类型别名 | 完全展开后的类型 |
+| 函数/挂起函数、反射类型、协程/flow/channel 状态 | 拒绝 |
+| 符合条件的第三方不可变 Kotlin 模型 | 在 JVM 上自动映射;应用注解覆盖时需注册精确 Mixin |
时间和 UUID API 的 Kotlin 实验性 opt-in 要求仍适用于应用源码。Fory 制品支持的编译器和元数据范围,并不意味着实验性 Kotlin API 获得跨 Kotlin 版本的兼容保证。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/object-mapping.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/object-mapping.md
index 0193696c62e..94475fbffa9 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/object-mapping.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/object-mapping.md
@@ -130,17 +130,17 @@ Schema 仍应声明预期的 Java 类型。
这些内置值使用以下常规 JSON 形式:
-| Java 类型 | JSON 表示形式 |
+| Java 类型 | JSON 表示形式 |
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
-| 布尔和数值标量 | 写入原生 JSON 布尔或数字;声明类型的目标也可读取带引号的相同 token 文本 |
-| Enum | 常量名称字符串 |
-| `Date`、`Calendar`、`java.sql.Date`、`Time`、`Timestamp` | 表示 epoch 毫秒数的数值 |
-| `TimeZone` | 时区 ID 字符串 |
-| Java 时间类型以及受支持的 chronology 日期类型 | 对应的标准文本形式字符串 |
+| 布尔和数值标量 | 写入原生 JSON 布尔或数字;声明类型的目标也可读取带引号的相同 token 文本 |
+| Enum | 常量名称字符串 |
+| `Date`、`Calendar`、`java.sql.Date`、`Time`、`Timestamp` | 表示 epoch 毫秒数的数值 |
+| `TimeZone` | 时区 ID 字符串 |
+| Java 时间类型以及受支持的 chronology 日期类型 | 对应的标准文本形式字符串 |
| `UUID`、`URI`、`File`、`Path`、`Locale`、`Charset`、`Currency`、`Pattern` | 对应类型的文本字符串;`File` 和 `Path` 使用路径文本,`Locale` 使用语言标签,`Pattern` 不保留 flags |
-| `BitSet` | 由有符号 `long` 字组成的数组,来源为 `BitSet.toLongArray()` |
-| `ByteBuffer` | 从 position 到 limit 的剩余范围所对应的有符号字节值数组 |
-| Optional 和原子包装类型 | 直接使用其中包含的标量、数组或值 |
+| `BitSet` | 由有符号 `long` 字组成的数组,来源为 `BitSet.toLongArray()` |
+| `ByteBuffer` | 从 position 到 limit 的剩余范围所对应的有符号字节值数组 |
+| Optional 和原子包装类型 | 直接使用其中包含的标量、数组或值 |
`Calendar` 会把 epoch 毫秒数读入新的 `GregorianCalendar`;不会保留原始日历子类型、时区和其他配置。
null `Optional` 引用和空 `Optional` 都会写为 JSON null;将 JSON null 读取为声明的 Optional 类型时,
@@ -194,24 +194,47 @@ ForyJson json = ForyJson.builder().defaultPropertyInclusion(Include.NON_EMPTY).b
```
`defaultPropertyInclusion` 和 `writeNullFields` 修改同一个设置,以最后一次调用为准。
-builder 接受 `ALWAYS`、`NON_NULL` 和 `NON_EMPTY`;`DEFAULT` 仅适用于属性注解。
-显式的 `JsonProperty.include` 优先于 builder 默认值。空值的定义与适用范围请参阅
+builder 接受 `ALWAYS`、`NON_NULL` 和 `NON_EMPTY`,拒绝 `DEFAULT` 和 `NON_DEFAULT`。
+省略默认值需要通过属性上的 `@JsonProperty(include = NON_DEFAULT)` 或类上的 `@JsonInclude(NON_DEFAULT)`
+显式授权;支持的默认值来源、构造与求值影响以及错误行为见[默认值省略](annotations.md#jsoninclude-and-default-omission)。
+属性上的 `JsonProperty.include` 优先于类上的 `JsonInclude`,后者优先于 builder 默认值。空值定义与适用范围见
[属性包含策略](annotations.md#jsonproperty)。
-| Builder 方法 | 默认值 | 用户可见的效果 |
-| -------------------------------------- | ----------------------------------------- | ---------------------------------------------- |
-| `defaultPropertyInclusion(Include)` | `NON_NULL` | 对象属性的默认包含策略 |
-| `writeNullFields(boolean)` | `false` | 为 true 时选择 `ALWAYS`,为 false 时选择 `NON_NULL` |
-| `writeLongAsString(boolean)` | `false` | 将内置 64 位整数值写为十进制字符串 |
-| `withCodegen(boolean)` | `true` | 启用生成的对象编解码器 |
-| `withAsyncCompilation(boolean)` | `true` | 异步编译生成的编解码器 |
-| `withFieldMode(boolean)` | `false` | 为 true 时,仅发现字段而不使用 getter/setter |
-| `withPropertyNamingStrategy(strategy)` | `LOWER_CAMEL_CASE` | 为未显式指定 `JsonProperty` 名称的属性命名 |
-| `withMaxCachedFieldNames(int)` | `DEFAULT_MAX_CACHED_FIELD_NAMES` (`8192`) | 每个 reader 的字段名缓存条目数;零表示禁用缓存 |
-| `withConcurrencyLevel(int)` | `max(1, 2 * processors)` | 根操作的最大并发数 |
-| `withBufferSizeLimitBytes(int)` | 2 MiB | 每个池化 writer 可保留的最大复用容量 |
-| `registerCodec(type, codec)` | None | 替换允许注册的精确类的完整 JSON 编解码器 |
-| `registerMixin(mixinType)` | None | 将一个注解 Mixin 应用于其精确声明的目标 |
+| Builder 方法 | 默认值 | 用户可见的效果 |
+| --------------------------------------- | ----------------------------------------- | --------------------------------------------------- |
+| `defaultPropertyInclusion(Include)` | `NON_NULL` | 对象属性的默认包含策略 |
+| `writeNullFields(boolean)` | `false` | 为 true 时选择 `ALWAYS`,为 false 时选择 `NON_NULL` |
+| `writeLongAsString(boolean)` | `false` | 将内置 64 位整数值写为十进制字符串 |
+| `escapeNonAscii(boolean)` | `false` | 将生成的 JSON 字符串和名称中的非 ASCII 字符转义 |
+| `byteArrayFormat(JsonByteArray.Format)` | `BASE64` | 字节数组读写的默认表示方式 |
+| `withCodegen(boolean)` | `true` | 启用生成的对象编解码器 |
+| `withAsyncCompilation(boolean)` | `true` | 异步编译生成的编解码器 |
+| `withFieldMode(boolean)` | `false` | 为 true 时,仅发现字段而不使用 getter/setter |
+| `withPropertyNamingStrategy(strategy)` | `LOWER_CAMEL_CASE` | 为未显式指定 `JsonProperty` 名称的属性命名 |
+| `withMaxCachedFieldNames(int)` | `DEFAULT_MAX_CACHED_FIELD_NAMES` (`8192`) | 每个 reader 的字段名缓存条目数;零表示禁用缓存 |
+| `withConcurrencyLevel(int)` | `max(1, 2 * processors)` | 根操作的最大并发数 |
+| `withBufferSizeLimitBytes(int)` | 2 MiB | 可保留的输出缓冲区或字符串解码缓冲区的最大容量 |
+| `registerCodec(type, codec)` | None | 替换允许注册的精确类的完整 JSON 编解码器 |
+| `registerMixin(mixinType)` | None | 将一个注解 Mixin 应用于其精确声明的目标 |
+
+使用 `byteArrayFormat` 为普通 `byte[]` 根值、未标注的属性及容器中的值选择统一表示,
+包括嵌套数组、集合、Map 和 Optional:
+
+```java
+import org.apache.fory.json.ForyJson;
+import org.apache.fory.json.annotation.JsonByteArray;
+
+ForyJson hexJson = ForyJson.builder().byteArrayFormat(JsonByteArray.Format.BASE16).build();
+String text = hexJson.toJson(new byte[] {1, -2, 3}); // "\"01fe03\""
+byte[] bytes = hexJson.fromJson(text, byte[].class);
+```
+
+默认的 `BASE64` 写入带填充符的标准 Base64 字符串。`BASE16` 写入不带前缀或分隔符的小写十六进制
+字符串,读取时接受大小写字母和 JSON 字符串转义,拒绝奇数长度和非十六进制字符。
+`ARRAY` 使用 `[-128, 127]` 范围内的有符号数字。空数组在字符串格式下写为 `""`,在 `ARRAY` 下写为 `[]`。
+三种格式都接受 JSON `null`。读取使用配置的表示方式,不猜测其他格式。
+[属性上的 `JsonByteArray` 注解](annotations.md#jsonbytearray)(包括 Mixin 提供的注解)覆盖全局默认值。
+声明位置上的自定义编解码器保留其完整表示;Kotlin 无符号语义数组仍使用数字数组。
当 64 位整数必须经过 JavaScript 且不能损失 `Number` 精度时,请启用 `writeLongAsString(true)`。
该设置会将内置 `long`/`Long`、`AtomicLong`、`AtomicLongArray` 和 `OptionalLong` 值写为带引号的
@@ -221,7 +244,7 @@ builder 接受 `ALWAYS`、`NON_NULL` 和 `NON_EMPTY`;`DEFAULT` 仅适用于属
并发级别和缓冲区保留限制必须为正数。字段名缓存上限分别应用于每个 reader;零会禁用该缓存。该上限
只限制缓存的字段名数量,不限制输入中可接受的名称。缓冲区保留设置不会限制 JSON 输入或输出大小,
-只限制一次操作结束后保留以供复用的 writer 存储空间。
+只限制一次操作后各个可复用输出缓冲区或字符串解码缓冲区的容量,不限制实例使用的总内存。
有关类加载、类型策略、嵌套深度、对象图内存限制和外部输入控制,请参阅
[Fory JSON 安全](security.md)。
@@ -229,3 +252,44 @@ builder 接受 `ALWAYS`、`NON_NULL` 和 `NON_EMPTY`;`DEFAULT` 仅适用于属
调用 `build()` 之后再修改 builder,不会改变已有的 `ForyJson` 实例。
在 Android 上禁用运行时代码生成和异步编译。GraalVM 原生镜像中无法进行运行时编译。Fory JSON 会为默认配置以及每个可达 `ForyJsonProvider` 配置下的可达模型生成编解码器。没有匹配生成编解码器的模型使用解释执行编解码器。其他 builder 选项保持上述行为。
+
+## 非 ASCII 转义 {#non-ascii-escaping}
+
+当接收方要求使用 JSON Unicode 转义表示非 ASCII 字符时,可以启用:
+
+```java
+import org.apache.fory.json.ForyJson;
+
+ForyJson json = ForyJson.builder().escapeNonAscii(true).build();
+String text = json.toJson("汉é"); // "\u6c49\u00e9"
+byte[] utf8 = json.toJsonBytes("汉é");
+```
+
+该选项适用于所有 String、UTF-8、流式和格式化写入 API 中的字符串和字符值、属性名、Map 键、
+枚举名和子类型名。U+007F 以上的字符使用小写十六进制转义,补充字符使用两个 UTF-16 代理项转义。
+JSON 必需的转义保持不变,字符串中的无效代理项序列仍会失败。
+`<`、`>` 和 `&` 等 ASCII 字符不会被额外转义。
+
+该设置默认为 `false`,实例构建后固定。需要交替使用不同输出策略时,应复用两个实例。
+格式化输出仍按次调用选择,读取行为不受影响。关闭此选项会保留既有输出表示,包括原有的转义。
+
+调用方提供的原始 JSON(包括 `@JsonRawValue`)会原样保留,因此包含原始 JSON 的文档仍可能含有
+非 ASCII 字符。自定义编解码器应使用结构化字符串写入方法以遵循该选项;直接写入原始内容的转义
+仍由编解码器作者负责。
+
+## 格式化输出 {#pretty-printing}
+
+可以为单次序列化调用选择便于阅读的输出:
+
+```java
+ForyJson json = ForyJson.builder().build();
+String text = json.toPrettyJson(value);
+byte[] utf8 = json.toPrettyJsonBytes(value);
+String compact = json.toJson(value);
+```
+
+格式与为对象和数组都配置两个空格缩进的 Jackson pretty printer 一致。每层容器增加一级缩进,
+冒号两侧各有一个空格。空对象和空数组分别为 `{ }` 和 `[ ]`,换行使用 `\n`,末尾没有换行。
+两个 API 均保留字符串的逻辑值,并遵循 `escapeNonAscii`。原始 JSON 值及其空白保持原样。
+读取同时接受紧凑和格式化 JSON。同一个实例可以按次切换输出格式;既有的
+`toJson`、`toJsonBytes` 和 `writeJsonTo` 继续输出紧凑 JSON。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/scala.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/scala.md
index b1c0a5aa7cd..ad6311ce5b1 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/scala.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/scala.md
@@ -24,7 +24,7 @@ Fory JSON 通过可选的 `fory-json-scala` 制品支持 Scala 2.13 和 Scala 3
## 设置 {#setup}
```sbt
-libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.4"
+libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.5"
```
`ForyJsonScala.builder()` 安装 Scala 模块并返回标准 Fory JSON builder:
@@ -40,16 +40,59 @@ val person = json.fromJson(text, classOf[Person])
```
请复用得到的 `ForyJson` 实例。它在构建后不可变且线程安全。
+使用 `ForyJsonScala.builder().escapeNonAscii(true)` 可在紧凑和格式化输出中转义非 ASCII 字符串内容与名称。
+该设置在实例构建后固定;原始 JSON 保持原样。见[非 ASCII 转义](object-mapping.md#non-ascii-escaping)。
+
使用 `ForyJsonScala.builder().writeLongAsString(true)` 可将 Scala `Long` 值以带引号的十进制字符串
输出,包括声明的 collection 和 Map 值、`Option[Long]`、以 `Long` 为底层值的值类以及 Java Long
类包装器。Reader 同时接受带引号和不带引号的整数 token。参数化声明包含 `Long` 时应使用
`ScalaTypeRef`,因为普通 JVM 签名可能会将 Scala 值类型参数擦除为 `Object`。
+## 字节数组格式 {#byte-array-formats}
+
+Scala `Array[Byte]` 默认使用 Base64 字符串。标准 builder 的 `byteArrayFormat` 可选择数字数组或
+十六进制字符串,也适用于 `Option`、Scala 集合和 Map 中的数组:
+
+```scala
+import org.apache.fory.json.annotation.JsonByteArray
+import org.apache.fory.json.scala.{ForyJsonScala, ScalaTypeRef}
+
+val hexJson = ForyJsonScala.builder().byteArrayFormat(JsonByteArray.Format.BASE16).build()
+val bytesType = ScalaTypeRef[Array[Byte]]
+val text = hexJson.toJson(Array[Byte](1, -2, 3), bytesType) // "\"01fe03\""
+val bytes = hexJson.fromJson(text, bytesType)
+```
+
+字段或 getter 上的 `JsonByteArray`(包括 Mixin)覆盖该属性的默认值。
+读写契约见[字节数组格式](object-mapping.md#builder-configuration)。
+
## Case class 与注解 {#case-classes-and-annotations}
-case class 通过调用完整主构造函数解码。对于缺失且有默认值的参数,Fory 调用 Scala 生成的构造函数默认值方法,不解析默认值表达式,也不修改构造函数 `val` 字段。后续参数列表中的默认值会按 Scala 语义接收前面已确定的构造函数参数。缺少无默认值的参数会报错。类体中的可变属性在构造后赋值。
+case class 通过调用完整主构造函数解码。对于缺失且有默认值的参数,Fory 调用 Scala 生成的构造函数默认值方法,
+不解析默认值表达式,也不修改构造函数 `val` 字段。后续参数列表中的默认值会按 Scala 语义接收前面的构造函数参数。
+构造函数参数没有显式默认值时,缺失属性使用类型默认值:
+
+- 数值使用零,Boolean 使用 `false`。
+- 集合、Map 和数组使用空值。每个对象的可变默认值相互独立。
+- `Option[A]` 使用 `None`。
+- 其他引用值(包括字符串和嵌套对象)使用 `null`。
+
+类体中的可变属性在缺失时保留初始化值,存在时在构造后赋值。
+
+```scala
+case class Options(value: Option[Int], selected: Option[Int] = Some(7))
+case class Profile(age: Int, enabled: Boolean, tags: List[String], name: String)
+
+json.fromJson("{}", classOf[Options]) // Options(None, Some(7))
+json.fromJson("""{"selected":null}""", classOf[Options]) // Options(None, None)
+json.fromJson("{}", classOf[Profile]) // Profile(0, false, List(), null)
+```
+
+显式构造函数默认值优先用于缺失的属性。显式 JSON `null` 对 `Option[A]` 解码为 `None`,
+即使其构造函数默认值为 `Some(...)` 也是如此。
case class 可以声明在顶层,也可以嵌套在任意层数的 `object` 内,但每一层外部作用域都必须是 `object`。如果外层是 `class`、trait 或方法,读写都会被拒绝,因为 Fory 无法访问重建值所需的外部实例或伴生对象。
+构造要求具有公共 JVM 构造函数以及匹配的公共伴生对象 `apply`;不支持的私有构造形式会被拒绝。
Fory JSON 注解可以直接放在 Scala 构造函数属性上:
@@ -66,32 +109,75 @@ case class Media(
`JsonIgnore` 适用于字段、属性方法、setter 参数和选定的构造函数参数。`JsonCodec` 子槽位绑定直接集合元素、`Option` 内容,以及 Map 键或值。其他 Fory JSON 注解保持[注解](annotations.md)中描述的行为。
-如果必需且没有默认值的引用参数使用了会省略 `null` 的包含规则,序列化会拒绝 null 值,以确保 Fory 写出的 JSON 仍可按同一个 case class Schema 读取。
-全局设置 `defaultPropertyInclusion(NON_EMPTY)` 会保留必需构造函数参数中的空值。
-如果必需参数的类型可能为空,显式的 `@JsonProperty(include = NON_EMPTY)` 会被拒绝;
-为该参数添加构造函数默认值后,才允许省略。
+属性包含策略控制写出的值。省略的属性在读取时使用构造函数或类型默认值,因此省略空字符串可能恢复为 `null`。
+如果需要保留区别,使用 `ALWAYS`。显式 JSON `null` 保持声明类型的常规 null 行为,不会请求构造函数默认值。
+
+`NON_EMPTY` 识别 `None` 和受支持的空严格求值 Scala 序列、集合、Map,包括可变集合和 range。
+过滤不递归:`Some("")`、`Some(Nil)`、`Some(null)` 和非空容器都会保留。
+它不会遍历惰性集合来判断是否为空,也不会移除根值、数组元素、Map 条目或元组位置。
+
+这些 Scala 编解码器实现 `isEmpty(writer, value)`。使用自定义编解码器替换它们时,需要重写该方法
+以保留所需的空值省略行为;默认返回 `false`。例如,没有重写该方法的自定义 Option 编解码器会在
+`NON_EMPTY` 下保留 `None` 属性。动态 `Any` 属性使用实际值选定的编解码器,属性专用的自定义
+编解码器控制自身空值检查。见[自定义空值](custom-codecs.md#custom-empty-values)。
+
+通过 `NON_DEFAULT` 显式授权稳定的声明默认值:
+
+```scala
+import org.apache.fory.json.annotation.JsonProperty.Include
+import org.apache.fory.json.annotation.{JsonInclude, JsonProperty}
+import org.apache.fory.json.scala.ForyJsonScala
+
+@JsonInclude(Include.NON_DEFAULT)
+case class Request(
+ @JsonProperty(include = Include.ALWAYS) id: Int,
+ retries: Int = 3,
+ tags: List[String] = Nil
+)
+
+val json = ForyJsonScala.builder().build()
+json.toJson(Request(0)) // {"id":0}
+json.fromJson("""{"id":0}""", classOf[Request]) // Request(0, 3, Nil)
+json.toJson(Request(0, retries = 0)) // {"id":0,"retries":0}
+```
+
+`id` 没有声明默认值,因此需要显式排除,否则类级授权会失败。读取时隐含的零、空集合或 `None`
+不是声明的默认值。也可移除类注解,只在选定的默认值属性上添加
+`@JsonProperty(include = Include.NON_DEFAULT)`。Mixin 支持两种形式;全局 `NON_DEFAULT` 会被拒绝。
+
+默认值表达式在写入时执行,必须具有确定性且没有外部可见副作用。
+对于 `case class Limits(low: Int)(val high: Int = low + 1)`,比较 `high` 时使用对象实际的 `low`。
+当 `low=5, high=2` 时会保留 high,因为默认值为 6。缺少默认值方法或写入 Schema 依赖时,
+模型初始化会失败。JVM 方法返回 `void` 的 `Unit` 默认值不能用作比较来源;
+授权整个类时,应通过 `ALWAYS` 保留这些属性。
+
+授权表示调用方确认缺失输入可以恢复相同上下文;Fory 不证明这一点或表达式的纯度。
+对于依赖时间、随机数或状态的默认值,应使用 `ALWAYS`。数组按内容比较,浮点数区分正零与负零。
+Scala 类体初始化器不会被推断为构造函数默认值。不同于默认值的值(包括 null 和空集合)仍会写出。
+读取行为独立,并创建新的可变默认值。类级授权也覆盖未来新增的字段,见
+[默认值省略](annotations.md#jsoninclude-and-default-omission)。
## 支持的 Scala 类型 {#supported-scala-types}
-| Scala 类型 | JSON 表示形式 |
-| ----------------------------------------------------------- | ----------------------------------------------- |
-| `Unit` | `null` |
-| case class | 对象 |
-| 单例对象 | 空对象 |
-| 值类 | 底层值 |
-| `Option[A]`、`Some[A]`、`None` | 所含值或 `null` |
-| `Either[L, R]` | 恰好包含一个 `l` 或 `r` 成员的对象 |
-| `List`、`Seq`、`Vector`、`Queue`、`ArraySeq`、buffer、set | 数组 |
-| Scala Map、`IntMap`、`LongMap` | 对象 |
-| 不可变与可变 `BitSet` | 升序整数数组 |
-| `Tuple1` 至 `Tuple22` | 定长数组 |
-| Scala 3 `EmptyTuple` | 空数组 |
-| `BigInt`、`BigDecimal` | JSON 数字 |
-| Scala `StringBuilder` | string |
-| `Range`、受支持的 `NumericRange` | 已求值的值数组 |
-| `FiniteDuration`、`Duration` | 固定的 `length`/`unit` 或 `special` 对象 |
-| 无参数的 Scala 3 枚举 | 字符串形式的枚举分支名 |
-| Scala 2 `Enumeration` | 通过绑定所属枚举的编解码器表示为字符串 |
+| Scala 类型 | JSON 表示形式 |
+| --------------------------------------------------------- | ---------------------------------------- |
+| `Unit` | `null` |
+| case class | 对象 |
+| 单例对象 | 空对象 |
+| 值类 | 底层值 |
+| `Option[A]`、`Some[A]`、`None` | 所含值或 `null` |
+| `Either[L, R]` | 恰好包含一个 `l` 或 `r` 成员的对象 |
+| `List`、`Seq`、`Vector`、`Queue`、`ArraySeq`、buffer、set | 数组 |
+| Scala Map、`IntMap`、`LongMap` | 对象 |
+| 不可变与可变 `BitSet` | 升序整数数组 |
+| `Tuple1` 至 `Tuple22` | 定长数组 |
+| Scala 3 `EmptyTuple` | 空数组 |
+| `BigInt`、`BigDecimal` | JSON 数字 |
+| Scala `StringBuilder` | string |
+| `Range`、受支持的 `NumericRange` | 已求值的值数组 |
+| `FiniteDuration`、`Duration` | 固定的 `length`/`unit` 或 `special` 对象 |
+| 无参数的 Scala 3 枚举 | 字符串形式的枚举分支名 |
+| Scala 2 `Enumeration` | 通过绑定所属枚举的编解码器表示为字符串 |
严格求值的标准库集合通过标准 Scala builder 重建。`Either` 写入紧凑的 `l` 和 `r` 成员名,读取器也接受旧的 `left` 和 `right` 名称。Fory 不增加 Scala 专用集合大小限制;编解码器使用与 Fory JSON 核心相同的输入长度、深度、对象图内存和读取进度限制。如果稀疏 `BitSet` 的最高索引要求分配与可用 JSON 输入不成比例的底层存储,则会被拒绝。
@@ -119,11 +205,53 @@ val rangeType = ScalaTypeRef[scala.collection.immutable.NumericRange[Int]]
val range = json.fromJson("[1,3,5,7]", rangeType)
```
+泛型 case class 保留类型参数,包括同一个类的有限嵌套:
+
+```scala
+case class Box[A](value: A)
+
+val boxType = ScalaTypeRef[Box[Box[Int]]]
+val box = json.fromJson("""{"value":{"value":1}}""", boxType)
+json.toJson(box, boxType) // {"value":{"value":1}}
+```
+
+持续扩张类型参数的递归声明(例如 `Node[A]` 包含 `Node[List[A]]`)需要自定义编解码器。
+`Unit` 根值应使用 `ScalaTypeRef[Unit]`:
+
+```scala
+val unitType = ScalaTypeRef[Unit]
+json.toJson((), unitType) // "null"
+json.fromJson("null", unitType) // ()
+```
+
+`Unit` 也支持 case class 字段及 `List[Unit]`、`Array[Unit]`、`Option[Unit]` 等嵌套类型。
+每个 `Unit` 值编码为 JSON `null`。由于 Option 使用值或 null 表示,`Some(())` 写为 `null` 后会读回 `None`。
+不要将 `classOf[Unit]` 传给 Java `Class` 重载:它表示 JVM `void`,作为根值写入时会被拒绝。
+
提供完整类型参数时,`Some[Int]` 是有效声明类型。非 null JSON 值解码为 `Some(value)`;`Some[Int]` 拒绝 JSON `null`,而 `Option[Int]` 将其解码为 `None`。
## Scala 2 Enumeration
-Scala 2 会从 `Enumeration#Value` 中擦除所属的 `Enumeration`。使用 `JsonEnumeration` 可在直接值、集合或数组元素、`Option` 内容以及 Map 键/值上保留其所属枚举:
+在 Scala 2.13 和 Scala 3 上,使用 `ScalaTypeRef` 保留静态已知的枚举所有者,
+包括数组、集合、Option 和 Map 中的枚举:
+
+```scala
+import org.apache.fory.json.scala.{ForyJsonScala, ScalaTypeRef}
+
+object Suit extends Enumeration {
+ val Hearts, Clubs = Value
+}
+
+val json = ForyJsonScala.builder().build()
+val suits = ScalaTypeRef[Array[Suit.Value]]
+val values = json.fromJson("""["Hearts","Clubs"]""", suits)
+val text = json.toJson(values, suits)
+```
+
+每个类型使用位置分别选定所有者,不同枚举可在同一运行时共存,无需为共享的 `Enumeration.Value` 类注册。
+保留所有者的类型别名也受支持。被擦除的 `Enumeration#Value`、`Class` 或普通 JVM `TypeRef` 无法恢复所有者。
+通过 JVM 反射发现的 case class 属性,如果签名已擦除所有者,需要使用 `JsonEnumeration`。
+该注解可用于直接值、集合或数组元素、`Option` 内容以及 Map 键/值:
```scala
import org.apache.fory.json.scala.JsonEnumeration
@@ -151,9 +279,61 @@ case class Schedule(
自定义编码表示时,扩展 `ScalaEnumerationCodec` 并通过 `@JsonCodec` 选择该编解码器。该编解码器也实现 Map 键契约,因此其类可用于 `keyCodec`。
+## 单例 sealed ADT {#singleton-sealed-adts}
+
+在 Scala 2.13 和 Scala 3 上,显式选择 `ScalaJsonCodec.stringEnum[T]`,
+可将由单例分支组成的封闭 sealed 类型层次编码为 JSON 字符串:
+
+```scala
+import org.apache.fory.json.scala.{ForyJsonScala, ScalaJsonCodec, ScalaTypeRef}
+
+sealed trait Color
+case object Red extends Color
+case object Blue extends Color
+
+val json = ForyJsonScala.builder()
+ .registerCodec(classOf[Color], ScalaJsonCodec.stringEnum[Color])
+ .build()
+val colors = ScalaTypeRef[Array[Color]]
+val text = json.toJson(Array[Color](Red, Blue), colors) // ["Red","Blue"]
+val values = json.fromJson(text, colors)
+```
+
+编译器发现分支及其名称,包括 sealed 中间分支下的分支,无需手写名称到成员的映射。
+开放抽象分支或包含构造函数参数的分支会在编译时被拒绝。未知输入名称会被拒绝,名称不会用于加载类,
+也不依赖重写的 `toString`。
+
+该表示需要显式选择。`ScalaJsonCodec.derived[T]` 保留包装对象表示,也支持显式注册的 Scala 2 sealed 层次。
+Scala 3 `derives` 和无参数 Scala 3 枚举的默认行为不变。`null` 仍表示为 JSON `null`。
+
+## 标量字符串 {#scalar-strings}
+
+在 Boolean 或数值属性上使用 `JsonFormat(shape = JsonFormat.Shape.STRING)`,
+可将标量 token 写为 JSON 字符串。读取同时接受字符串和原生标量 token:
+
+```scala
+import org.apache.fory.json.annotation.{JsonFormat, JsonMixin}
+import org.apache.fory.json.scala.ForyJsonScala
+
+case class Artifact(expired: Boolean, size: Long)
+
+@JsonMixin(target = classOf[Artifact])
+abstract class ArtifactMixin {
+ @JsonFormat(shape = JsonFormat.Shape.STRING) var expired: Boolean = false
+}
+
+val json = ForyJsonScala.builder().registerMixin(classOf[ArtifactMixin]).build()
+val text = json.toJson(Artifact(false, 7L)) // {"expired":"false","size":7}
+```
+
+也可以直接在构造函数属性上添加注解。Mixin 只使用 Fory 注解且不修改模型。
+除基本和装箱 Boolean/数值类型外,也支持 Scala `BigInt` 和 `BigDecimal`。
+null、非有限数及受支持的直接包装行为见[注解](annotations.md#jsonformat)。
+
## Scala 3 封闭枚举与 sealed 层次结构 {#scala-3-closed-enums-and-sealed-hierarchies}
-无参数的 Scala 3 枚举以分支名作为 JSON 字符串。对于带参数分支的枚举,添加 `derives ScalaJsonCodec`,即可为所有分支定义统一的封闭包装对象表示:
+无参数的 Scala 3 枚举以分支名作为 JSON 字符串,也可用作 `Map[Color, String]` 等有类型 Scala Map 的键。
+对于带参数分支的枚举,添加 `derives ScalaJsonCodec`,即可为所有分支定义统一的封闭包装对象表示:
```scala
import org.apache.fory.json.scala.*
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/security.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/security.md
index da20ee49564..9df26086112 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/security.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/json/security.md
@@ -64,7 +64,7 @@ ClassLoader。此后更改线程上下文 ClassLoader 不会影响该 `ForyJson`
内置计量包括 POJO 和 Record 的浅层存储,集合和 set 及候选元素引用槽位,Map 及候选键/值引用槽位,引用数组及其槽位,以及基本类型数组及其存储。自然 `JsonObject` 和 `JsonArray` 值遵循相同 Map 和集合规则。长度未知的集合、Map 和数组按 1024 项分批预留存储,在每批最后一个子元素之前及尾部执行。因此,重复 set 元素以及重复或被覆盖的 Map 成员,每次在输入中出现都会计量。即使所有元素都是叶子值,引用数组仍会计量;即使所有属性都是叶子值,对象也会计量。`AtomicReference`、`AtomicReferenceArray` 和泛型 `Optional<T>` 包含包装对象及引用存储。新分配的基本类型 Optional 或原子基本类型包装也会计量一次;缓存的空 Optional 单例不属于新的对象图所有者。
专用叶值 codec 不计入对象图:null、字符串、字符、布尔值、包括任意精度数在内的数值、枚举、
-时间及其他标量值,以及二进制值。由二进制或 Base64 codec 处理的 `byte[]` 仍是二进制叶值;
+时间及其他标量值,以及二进制值。由二进制、Base64 或 Base16 codec 处理的 `byte[]` 仍是二进制叶值;
从 JSON 数值数组读取的同一 Java 载体则是基本类型数组所有者。可用字节数和语法检查仍独立于对象图计量。
会实例化复合对象图所有者的自定义 codec,必须为每个复合应用对象、collection、Map 或引用数组调用
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/configuration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/configuration.md
index 68f97e86390..fe2231ac960 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/configuration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/configuration.md
@@ -136,7 +136,7 @@ auto fory = Fory::builder()
### max_schema_versions_per_type(uint32_t)
-设置一个逻辑类型可接受的远端元数据版本上限。
+设置一个逻辑类型可缓存的远端元数据版本上限。
```cpp
auto fory = Fory::builder()
@@ -146,6 +146,9 @@ auto fory = Fory::builder()
**Default:** `10`
+Schema 版本限制仅约束缓存的元数据。达到 Schema 版本或逻辑类型缓存上限后,有效数据仍会在完整
+元数据验证后反序列化,但不会缓存新 Schema。重复读取未缓存的 Schema 可能增加开销;既有缓存仍可复用。
+
### max_type_fields(uint32_t)
设置一个已接收远端结构体元数据主体可接受的最大字段数。
@@ -172,7 +175,7 @@ auto fory = Fory::builder()
### max_average_schema_versions_per_type(uint32_t)
-设置已接受远端类型的平均可接受远端元数据版本数。有效的全局下限为 `8192` 个 Schema。
+设置已缓存远端类型的平均可接受远端元数据版本数。有效的全局下限为 `8192` 个 Schema。
```cpp
auto fory = Fory::builder()
@@ -227,8 +230,8 @@ auto fory = Fory::builder().build_thread_safe(); // Returns ThreadSafeFory
| `max_dyn_depth(uint32_t)` | 动态类型的最大嵌套深度 | `5` |
| `max_type_fields(uint32_t)` | 一个已接收结构体元数据主体的最大字段数 | `512` |
| `max_type_meta_bytes(uint32_t)` | 一个已接收元数据主体的最大编码字节数 | `4096` |
-| `max_schema_versions_per_type(uint32_t)` | 一个逻辑类型的最大远端元数据版本数 | `10` |
-| `max_average_schema_versions_per_type(uint32_t)` | 各类型的平均远端元数据版本数 | `3` |
+| `max_schema_versions_per_type(uint32_t)` | 一个逻辑类型的最大缓存远端元数据版本数 | `10` |
+| `max_average_schema_versions_per_type(uint32_t)` | 各类型的平均缓存远端元数据版本数 | `3` |
| `check_struct_version(bool)` | 启用结构体版本检查 | `false` |
## 安全
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/index.md
index eeb42eb4a24..a8d57c2646c 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/index.md
@@ -60,7 +60,7 @@ include(FetchContent)
FetchContent_Declare(
fory
GIT_REPOSITORY https://github.com/apache/fory.git
- GIT_TAG v1.7.4
+ GIT_TAG v1.7.5
SOURCE_SUBDIR cpp
)
FetchContent_MakeAvailable(fory)
@@ -90,11 +90,11 @@ module(
bazel_dep(name = "rules_cc", version = "0.1.1")
-bazel_dep(name = "fory", version = "1.7.4")
+bazel_dep(name = "fory", version = "1.7.5")
git_override(
module_name = "fory",
remote = "https://github.com/apache/fory.git",
- commit = "v1.7.4", # Or use a specific commit hash for reproducibility
+ commit = "v1.7.5", # Or use a specific commit hash for reproducibility
)
```
@@ -125,7 +125,7 @@ bazel run //:my_app
本地开发时,可以改用 `local_path_override`:
```bazel
-bazel_dep(name = "fory", version = "1.7.4")
+bazel_dep(name = "fory", version = "1.7.5")
local_path_override(
module_name = "fory",
path = "/path/to/fory",
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/security.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/security.md
index 7771b5a4a79..6cf5d33cacd 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/security.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/cpp/security.md
@@ -39,7 +39,8 @@ license: |
- 对有意使用相同 Schema 的载荷,将 `check_struct_version(true)` 与 `compatible(false)` 配合使用。
- 对大多数输入,将 `max_graph_memory_bytes(...)` 保持为固定默认值 `128 MiB`;只有可信工作负载需要不同的集合/映射/结构体限制时才设置正值。
- 在模型允许范围内尽量降低 `max_dyn_depth(...)`,以拒绝意外过深的多态对象图。
-- 除非数据确定无恶意且可信对等端会发送更大的元数据或大量 Schema 版本,否则请保留远端 Schema 元数据限制的默认值。
+- 保持远程元数据大小限制的默认值,除非可信通信方需要更大的元数据。
+ Schema 版本限制只约束缓存;更多有效 Schema 会在不缓存的情况下解码。
- 对不可信输入,优先使用具体字段而非宽泛的多态字段。
## 验证
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/configuration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/configuration.md
index a6f39f8f575..9df9698a647 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/configuration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/configuration.md
@@ -44,8 +44,8 @@ ThreadSafeFory threadSafe = Fory.Builder().BuildThreadSafe();
| `MaxUnbackedContainerItems` | `8192` | 每次根值读取允许的无输入支撑 collection/map 工作量 |
| `MaxTypeFields` | `512` | 单个已接收结构体元数据主体的最大字段数 |
| `MaxTypeMetaBytes` | `4096` | 单个已接收元数据主体的最大编码字节数 |
-| `MaxSchemaVersionsPerType` | `10` | 单个逻辑类型的最大远程元数据版本数 |
-| `MaxAverageSchemaVersionsPerType` | `3` | 所有类型的平均远程元数据版本数 |
+| `MaxSchemaVersionsPerType` | `10` | 单个逻辑类型的最大缓存远程元数据版本数 |
+| `MaxAverageSchemaVersionsPerType` | `3` | 所有类型的平均缓存远程元数据版本数 |
## 构建器选项
@@ -138,7 +138,7 @@ Fory fory = Fory.Builder()
### `MaxSchemaVersionsPerType(int value)`
-设置单个逻辑类型允许的最大远程元数据版本数。
+设置单个逻辑类型可缓存的最大缓存远程元数据版本数。
```csharp
Fory fory = Fory.Builder()
@@ -146,9 +146,12 @@ Fory fory = Fory.Builder()
.Build();
```
+Schema 版本限制仅约束缓存的元数据。达到 Schema 版本或逻辑类型缓存上限后,有效数据仍会在完整
+元数据验证后反序列化,但不会缓存新 Schema。重复读取未缓存的 Schema 可能增加开销;既有缓存仍可复用。
+
### `MaxAverageSchemaVersionsPerType(int value)`
-设置所有已接受远程类型允许的平均远程元数据版本数。有效的全局下限为 `8192` 个 Schema。
+设置所有已缓存远程类型可缓存的平均缓存远程元数据版本数。有效的全局下限为 `8192` 个 Schema。
```csharp
Fory fory = Fory.Builder()
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/index.md
index a5df62f5474..adee666bc03 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/index.md
@@ -44,7 +44,7 @@ Apache Fory™ C# 是面向 .NET 的高性能跨语言序列化库。它支持
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.4" />
+ <PackageReference Include="Apache.Fory" Version="1.7.5" />
</ItemGroup>
```
@@ -87,7 +87,7 @@ User decoded = fory.Deserialize<User>(payload);
| 主题 | 说明 |
| --------------------------------------- | ------------------------------------- |
| [配置](configuration.md) | 构建器选项和模式设置 |
-| [基本序列化](basic-serialization.md) | 类型化和动态序列化 API |
+| [基本序列化](basic-serialization.md) | 类型化和动态序列化 API |
| [Schema 元数据](schema-metadata.md) | `[ForyField]` ID 和 Schema 类型描述符 |
| [类型注册](type-registration.md) | 注册用户类型和自定义序列化器 |
| [外部类型](external-types.md) | 第三方类型的序列化器 |
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/security.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/security.md
index c3e71d343e1..a5d8620b02f 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/security.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/csharp/security.md
@@ -39,7 +39,8 @@ license: |
- 对有意使用的相同 Schema 载荷,使用 `CheckStructVersion(true)` 并配合 `Compatible(false)`。
- 设置 `MaxDepth(...)`,拒绝深度超出预期的动态对象图。
- 将 `MaxGraphMemoryBytes(...)` 设为包含大量 collection、map、array、struct 和 object 的载荷的近似限制。它并非精确的堆上限;叶子值受剩余输入字节限制。
-- 保持远程 Schema 元数据限制的默认值,除非数据可信且可信通信方会发送更大的元数据或大量 Schema 版本。
+- 保持远程元数据大小限制的默认值,除非可信通信方需要更大的元数据。
+ Schema 版本限制只约束缓存;更多有效 Schema 会在不缓存的情况下解码。
- 对不可信输入,优先使用生成或注册的具体模型,而不是宽泛的动态字段。
## 验证
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/configuration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/configuration.md
index d10816e6124..6499c1a5ed0 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/configuration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/configuration.md
@@ -87,7 +87,7 @@ final fory = Fory(maxDepth: 128);
### 远程 Schema 元数据限制
-兼容模式可以接收用于 Schema 演进的远程元数据。以下限制约束元数据大小和允许的 Schema 版本数:
+兼容模式可以接收用于 Schema 演进的远程元数据。以下限制约束元数据大小和可缓存的 Schema 版本数:
```dart
final fory = Fory(
@@ -100,8 +100,11 @@ final fory = Fory(
- `maxTypeFields` 限制单个已接收 struct 元数据主体中的字段数。
- `maxTypeMetaBytes` 限制单个已接收 TypeMeta 主体中的编码主体字节数,不包括 8 字节头部和任何扩展大小 varint。
-- `maxSchemaVersionsPerType` 限制单个逻辑类型允许的远程元数据版本数。
-- `maxAverageSchemaVersionsPerType` 限制所有已接受远程类型的平均值。有效的全局下限为 `8192` 个 Schema。
+- `maxSchemaVersionsPerType` 限制单个逻辑类型可缓存的远程元数据版本数。
+- `maxAverageSchemaVersionsPerType` 限制所有已缓存远程类型的平均值。有效的全局下限为 `8192` 个 Schema。
+
+Schema 版本限制仅约束缓存的元数据。达到 Schema 版本或逻辑类型缓存上限后,有效数据仍会在完整
+元数据验证后反序列化,但不会缓存新 Schema。重复读取未缓存的 Schema 可能增加开销;既有缓存仍可复用。
### `maxGraphMemoryBytes`
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/index.md
index f65567dd5e5..b39d5ae085e 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/index.md
@@ -44,7 +44,7 @@ Apache Fory™ Dart 可以将 Dart 对象序列化为字节并反序列化,也
```yaml
dependencies:
- fory: ^1.7.4
+ fory: ^1.7.5
dev_dependencies:
build_runner: ^2.4.0
@@ -132,7 +132,7 @@ dart run build_runner build
| 主题 | 说明 |
| --------------------------------------- | ---------------------------------------------- |
| [配置](configuration.md) | Fory 选项、兼容模式和安全限制 |
-| [基本序列化](basic-serialization.md) | `serialize`、`deserialize`、生成注册和根对象图 |
+| [基本序列化](basic-serialization.md) | `serialize`、`deserialize`、生成注册和根对象图 |
| [代码生成](code-generation.md) | `@ForyStruct`、build runner 和生成模块 |
| [Struct 继承](inheritance.md) | 父类、mixin、私有字段和构造函数 |
| [外部类型序列化](external-types.md) | 为其他包拥有的类生成序列化器 |
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/security.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/security.md
index c75382c860e..3db768c4884 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/security.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/dart/security.md
@@ -39,7 +39,8 @@ license: |
- 对有意使用的相同 Schema 载荷,将 `checkStructVersion: true` 与 `compatible: false` 结合使用。
- 设置 `maxDepth`,拒绝深度超出预期的载荷结构。
- 对大多数输入保持 `maxGraphMemoryBytes` 默认值;对于已知可信且包含大量 collection/map/struct 的载荷,也可以设置显式正字节数限制。
-- 保持远程 Schema 元数据限制的默认值,除非数据可信且可信通信方会发送更大的元数据或大量 Schema 版本。
+- 保持远程元数据大小限制的默认值,除非可信通信方需要更大的元数据。
+ Schema 版本限制只约束缓存;更多有效 Schema 会在不缓存的情况下解码。
- 对不可信输入,优先使用生成的 Schema 和显式字段元数据,而不是宽泛的动态字段。
## 验证
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/go/configuration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/go/configuration.md
index d9a9eceffde..6f40690822d 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/go/configuration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/go/configuration.md
@@ -43,8 +43,8 @@ f := fory.New(fory.WithXlang(true))
| MaxUnbackedContainerItems | 8192 | 每次根读取中无输入支撑的集合/映射工作量 |
| MaxTypeFields | 512 | 一个已接收结构体元数据主体的最大字段数 |
| MaxTypeMetaBytes | 4096 | 一个已接收元数据主体的最大编码字节数 |
-| MaxSchemaVersionsPerType | 10 | 一个逻辑类型的最大远端元数据版本数 |
-| MaxAverageSchemaVersionsPerType | 3 | 各类型的平均远端元数据版本数 |
+| MaxSchemaVersionsPerType | 10 | 一个逻辑类型的最大缓存远端元数据版本数 |
+| MaxAverageSchemaVersionsPerType | 3 | 各类型的平均缓存远端元数据版本数 |
### 使用选项
@@ -169,15 +169,18 @@ f := fory.New(fory.WithMaxTypeMetaBytes(4096))
### WithMaxSchemaVersionsPerType
-设置一个逻辑类型可接受的远端元数据版本上限:
+设置一个逻辑类型可缓存的远端元数据版本上限:
```go
f := fory.New(fory.WithMaxSchemaVersionsPerType(10))
```
+Schema 版本限制仅约束缓存的元数据。达到 Schema 版本或逻辑类型缓存上限后,有效数据仍会在完整
+元数据验证后反序列化,但不会缓存新 Schema。重复读取未缓存的 Schema 可能增加开销;既有缓存仍可复用。
+
### WithMaxAverageSchemaVersionsPerType
-设置已接受远端类型的平均可接受远端元数据版本数。有效的全局下限为 `8192` 个 Schema:
+设置已缓存远端类型的平均可接受远端元数据版本数。有效的全局下限为 `8192` 个 Schema:
```go
f := fory.New(fory.WithMaxAverageSchemaVersionsPerType(3))
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/go/security.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/go/security.md
index 182bf5aa8b7..7e33a6b3e01 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/go/security.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/go/security.md
@@ -37,7 +37,8 @@ license: |
- 反序列化不可信数据前,只注册预期的结构体。
- 使用 `WithMaxDepth(...)` 拒绝意外过深的载荷。
-- 除非数据确定无恶意且可信对等端会发送更大的元数据或大量 Schema 版本,否则请保留远端 Schema 元数据限制的默认值。
+- 保持远程元数据大小限制的默认值,除非可信通信方需要更大的元数据。
+ Schema 版本限制只约束缓存;更多有效 Schema 会在不缓存的情况下解码。
- 对不可信输入,优先使用具体结构体字段,而非宽泛的 `any` 或接口类型字段。
## 验证
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/configuration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/configuration.md
index ed8bcabe41c..fd7206a5044 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/configuration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/configuration.md
@@ -23,36 +23,39 @@ license: |
## ForyBuilder 选项
-| 选项名称 | 说明 | 默认值 |
+| 选项名称 | 说明 | 默认值 |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
-| `timeRefIgnored` | 启用引用跟踪时,是否忽略 `TimeSerializers` 注册的所有时间类型及其子类的引用跟踪。若已忽略,可调用 `Fory#registerSerializer(Class, Serializer)` 为各时间类型启用引用跟踪,例如 `fory.registerSerializer(Date.class, new DateSerializer(fory.getConfig(), true))`。请注意,应在对包含时间字段的类型进行序列化器代码生成前启用引用跟踪,否则这些字段仍会跳过引用跟踪。 | `true` |
-| `compressInt` | 启用或禁用 int 压缩,以减小体积。 | `true` |
-| `compressLong` | 启用或禁用 long 压缩,以减小体积。 | `true` |
-| `compressIntArray` | 值较小时启用或禁用 int 数组压缩。显式注册 `CompressedArraySerializers` 后,JDK 8 至 15 使用标量宽度分析;JDK 16 及更高版本在解析 `jdk.incubator.vector` 时自动选择 Vector API 实现。 | `false` |
-| `compressLongArray` | 值较小时启用或禁用 long 数组压缩。显式注册 `CompressedArraySerializers` 后,JDK 8 至 15 使用标量宽度分析;JDK 16 及更高版本在解析 `jdk.incubator.vector` 时自动选择 Vector API 实现。 | `false` |
-| `compressString` | 启用或禁用字符串压缩,以减小体积。 | `false` |
-| `classLoader` | 每个 `Fory` 实例的类加载器固定不变,因为 Fory 会缓存类元数据。要使用不同的加载器,请创建配置了该加载器的新 `Fory` 或 `ThreadSafeFory`,或在首次解析类之前使用线程上下文类加载器。 | `Thread.currentThread().getContextClassLoader()` |
-| `compatible` | Schema 演进模式。`true`:读取端可以容忍兼容的字段新增、删除和重排。`false`:仅当每个读取端和写入端始终使用相同的类 Schema,并希望获得更快速度和更小体积时使用。未设置时,跨语言模式和原生模式都启用兼容模式。[了解更多](schema-evolution.md)。 | `true` |
-| `checkClassVersion` | 为明确使用相同 Schema 的载荷检查类版本哈希。兼容模式携带用于演进的 Schema 元数据,因此启用兼容模式时 Fory 会禁用该检查。 | `false` |
-| `checkJdkClassSerializable` | 启用或禁用对 `Serializable` 接口的检查,检查对象为 `java.*` 下的类。如果 `java.*` 下的类没有实现 `Serializable`,Fory 会抛出 `UnsupportedOperationException`。 | `true` |
-| `registerGuavaTypes` | 是否预注册 `RegularImmutableMap`/`RegularImmutableList` 等 Guava 类型。这些类型不是公共 API,但看起来相当稳定。 | `true` |
-| `requireClassRegistration` | 禁用后可能允许反序列化未知类,从而带来安全风险。 | `true` |
-| `maxDepth` | 设置反序列化最大深度;超过该深度时抛出异常,可用于抵御反序列化 DDoS 攻击。 | `50` |
-| `maxGraphMemoryBytes` | 单次根反序列化的近似对象图内存门限,主要覆盖实例化的集合、映射、数组、结构体和对象;叶子值由剩余输入字节约束。 | `134217728` |
-| `maxUnbackedContainerItems` | 单次根反序列化中,重复读取正文没有相应输入进度支撑的集合元素和映射条目的最大数量。零表示严格限制。 | `8192` |
-| `maxTypeFields` | 单个远程结构体元数据正文可接受的最大字段数。 | `512` |
-| `maxTypeMetaBytes` | 单个 TypeDef 或 TypeMeta 正文可接受的最大编码字节数,不含 8 字节头部和扩展长度 varint。 | `4096` |
-| `maxSchemaVersionsPerType` | 每个逻辑类型可接受的远程元数据版本上限。 | `10` |
-| `maxAverageSchemaVersionsPerType` | 所有已接受远程类型的平均远程元数据版本数。有效的全局下限为 `8192` 个元数据条目。 | `3` |
-| `suppressClassRegistrationWarnings` | 是否抑制类注册警告。这些警告可用于安全审计,但也可能造成干扰,因此默认启用抑制。 | `true` |
-| `metaShareEnabled` | 启用或禁用元数据共享模式。 | 兼容模式启用时为 `true`,否则为 false。 |
-| `scopedMetaShareEnabled` | 作用域元数据共享聚焦于单次序列化过程。该过程中创建或识别的元数据仅归其所有,不与其他序列化共享。 | 兼容模式启用时为 `true`,否则为 false。 |
-| `metaCompressor` | 为 Schema 元数据设置线程安全的压缩器。用于反序列化的自定义压缩器必须实现下文所述的有界解压。 | `DeflaterMetaCompressor` |
-| `deserializeUnknownClass` | 启用或禁用对不存在或未知类的数据进行反序列化或跳过。 | 兼容模式启用时为 `true`,否则为 false。 |
-| `codeGenEnabled` | 禁用后首次序列化可能更快,但后续序列化会更慢。未设置时,代码生成在普通 JVM 上默认启用,在 Android 和 GraalVM 原生镜像上默认禁用。Android 或 GraalVM 原生镜像接受显式 `withCodegen(true)`,但最终构建配置会强制使用解释器序列化器并发出警告。如果存在构建时 `@ForyStruct` 静态序列化器,普通 JVM 的 `withCodegen(false)` 和 Android 会使用它替代解释器对象序列化器。 | 普通 JVM 上为 `true`;Android 和 GraalVM 原生镜像上为 `false` |
-| `asyncCompilationEnabled` | 启用后,序列化先使用解释器模式,并在类的异步序列化器 JIT 完成后切换到 JIT 序列化。Android 和 GraalVM 原生镜像不支持运行时代码生成,因此会强制关闭此选项。 | `false` |
-| `copyRef` | 禁用后复制性能更好,但 Fory 深拷贝会忽略循环引用和共享引用。单次 `Fory#copy` 中,对象图里的同一引用会被复制为不同对象。 | `false` |
-| `serializeEnumByName` | 启用后,Fory 序列化枚举名称而非数字枚举 tag。未启用时,Fory 默认写入声明序号;如果枚举配置了 `@ForyEnumId`,则写入显式稳定 ID。 | `false` |
+| `timeRefIgnored` | 启用引用跟踪时,是否忽略 `TimeSerializers` 注册的所有时间类型及其子类的引用跟踪。若已忽略,可调用 `Fory#registerSerializer(Class, Serializer)` 为各时间类型启用引用跟踪,例如 `fory.registerSerializer(Date.class, new DateSerializer(fory.getConfig(), true))`。请注意,应在对包含时间字段的类型进行序列化器代码生成前启用引用跟踪,否则这些字段仍会跳过引用跟踪。 | `true` |
+| `compressInt` | 启用或禁用 int 压缩,以减小体积。 | `true` |
+| `compressLong` | 启用或禁用 long 压缩,以减小体积。 | `true` |
+| `compressIntArray` | 值较小时启用或禁用 int 数组压缩。显式注册 `CompressedArraySerializers` 后,JDK 8 至 15 使用标量宽度分析;JDK 16 及更高版本在解析 `jdk.incubator.vector` 时自动选择 Vector API 实现。 | `false` |
+| `compressLongArray` | 值较小时启用或禁用 long 数组压缩。显式注册 `CompressedArraySerializers` 后,JDK 8 至 15 使用标量宽度分析;JDK 16 及更高版本在解析 `jdk.incubator.vector` 时自动选择 Vector API 实现。 | `false` |
+| `compressString` | 启用或禁用字符串压缩,以减小体积。 | `false` |
+| `classLoader` | 每个 `Fory` 实例的类加载器固定不变,因为 Fory 会缓存类元数据。要使用不同的加载器,请创建配置了该加载器的新 `Fory` 或 `ThreadSafeFory`,或在首次解析类之前使用线程上下文类加载器。 | `Thread.currentThread().getContextClassLoader()` |
+| `compatible` | Schema 演进模式。`true`:读取端可以容忍兼容的字段新增、删除和重排。`false`:仅当每个读取端和写入端始终使用相同的类 Schema,并希望获得更快速度和更小体积时使用。未设置时,跨语言模式和原生模式都启用兼容模式。[了解更多](schema-evolution.md)。 | `true` |
+| `checkClassVersion` | 为明确使用相同 Schema 的载荷检查类版本哈希。兼容模式携带用于演进的 Schema 元数据,因此启用兼容模式时 Fory 会禁用该检查。 | `false` |
+| `checkJdkClassSerializable` | 启用或禁用对 `Serializable` 接口的检查,检查对象为 `java.*` 下的类。如果 `java.*` 下的类没有实现 `Serializable`,Fory 会抛出 `UnsupportedOperationException`。 | `true` |
+| `registerGuavaTypes` | 是否预注册 `RegularImmutableMap`/`RegularImmutableList` 等 Guava 类型。这些类型不是公共 API,但看起来相当稳定。 | `true` |
+| `requireClassRegistration` | 禁用后可能允许反序列化未知类,从而带来安全风险。 | `true` |
+| `maxDepth` | 设置反序列化最大深度;超过该深度时抛出异常,可用于抵御反序列化 DDoS 攻击。 | `50` |
+| `maxGraphMemoryBytes` | 单次根反序列化的近似对象图内存门限,主要覆盖实例化的集合、映射、数组、结构体和对象;叶子值由剩余输入字节约束。 | `134217728` |
+| `maxUnbackedContainerItems` | 单次根反序列化中,重复读取正文没有相应输入进度支撑的集合元素和映射条目的最大数量。零表示严格限制。 | `8192` |
+| `maxTypeFields` | 单个远程结构体元数据正文可接受的最大字段数。 | `512` |
+| `maxTypeMetaBytes` | 单个 TypeDef 或 TypeMeta 正文可接受的最大编码字节数,不含 8 字节头部和扩展长度 varint。 | `4096` |
+| `maxSchemaVersionsPerType` | 每个逻辑类型可缓存的远程元数据版本上限。 | `10` |
+| `maxAverageSchemaVersionsPerType` | 所有已缓存远程类型的平均缓存远程元数据版本数。有效的全局下限为 `8192` 个元数据条目。 | `3` |
+| `suppressClassRegistrationWarnings` | 是否抑制类注册警告。这些警告可用于安全审计,但也可能造成干扰,因此默认启用抑制。 | `true` |
+| `metaShareEnabled` | 启用或禁用元数据共享模式。 | 兼容模式启用时为 `true`,否则为 false。 |
+| `scopedMetaShareEnabled` | 作用域元数据共享聚焦于单次序列化过程。该过程中创建或识别的元数据仅归其所有,不与其他序列化共享。 | 兼容模式启用时为 `true`,否则为 false。 |
+| `metaCompressor` | 为 Schema 元数据设置线程安全的压缩器。用于反序列化的自定义压缩器必须实现下文所述的有界解压。 | `DeflaterMetaCompressor` |
+| `deserializeUnknownClass` | 启用或禁用对不存在或未知类的数据进行反序列化或跳过。 | 兼容模式启用时为 `true`,否则为 false。 |
+| `codeGenEnabled` | 禁用后首次序列化可能更快,但后续序列化会更慢。未设置时,代码生成在普通 JVM 上默认启用,在 Android 和 GraalVM 原生镜像上默认禁用。Android 或 GraalVM 原生镜像接受显式 `withCodegen(true)`,但最终构建配置会强制使用解释器序列化器并发出警告。如果存在构建时 `@ForyStruct` 静态序列化器,普通 JVM 的 `withCodegen(false)` 和 Android 会使用它替代解释器对象序列化器。 | 普通 JVM 上为 `true`;Android 和 GraalVM 原生镜像上为 `false` |
+| `asyncCompilationEnabled` | 启用后,序列化先使用解释器模式,并在类的异步序列化器 JIT 完成后切换到 JIT 序列化。Android 和 GraalVM 原生镜像不支持运行时代码生成,因此会强制关闭此选项。 | `false` |
+| `copyRef` | 禁用后复制性能更好,但 Fory 深拷贝会忽略循环引用和共享引用。单次 `Fory#copy` 中,对象图里的同一引用会被复制为不同对象。 | `false` |
+| `serializeEnumByName` | 启用后,Fory 序列化枚举名称而非数字枚举 tag。未启用时,Fory 默认写入声明序号;如果枚举配置了 `@ForyEnumId`,则写入显式稳定 ID。 | `false` |
+
+Schema 版本限制仅约束缓存的元数据。达到 Schema 版本或逻辑类型缓存上限后,有效数据仍会在完整
+元数据验证后反序列化,但不会缓存新 Schema。重复读取未缓存的 Schema 可能增加开销;既有缓存仍可复用。
### 自定义元数据压缩器 {#custom-metadata-compressors}
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/index.md
index 08b5d652a42..91f2624954d 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/index.md
@@ -51,7 +51,7 @@ Fory core 支持 Java 8 及更高版本。Java Record 序列化需要 Java 17
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-core</artifactId>
- <version>1.7.4</version>
+ <version>1.7.5</version>
</dependency>
```
@@ -59,7 +59,7 @@ Fory core 支持 Java 8 及更高版本。Java Record 序列化需要 Java 17
```kotlin
// Binary object serialization
-implementation("org.apache.fory:fory-core:1.7.4")
+implementation("org.apache.fory:fory-core:1.7.5")
```
#### JDK 25 及更高版本
@@ -235,7 +235,7 @@ Fory JSON 具有独立的 [Android](../../json/android.md) 和 [GraalVM 原生
| 分组 | 页面 |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| 序列化模式 | [基础序列化](basic-serialization.md)、[原生序列化](native.md) |
+| 序列化模式 | [基础序列化](basic-serialization.md)、[原生序列化](native.md) |
| 通用 | [配置](configuration.md)、[类型注册](type-registration.md)、[Schema 演进](schema-evolution.md)、[Schema 元数据](schema-metadata.md)、[自定义序列化器](custom-serializers.md) |
| Java 专用功能 | [高级功能](advanced-features.md)、[压缩](compression.md)、[对象复制](object-copy.md)、[JDK 自定义序列化](jdk-serialization.md)、[静态生成的序列化器](static-generated-serializers.md)、[虚拟线程](virtual-threads.md) |
| 平台与运维 | [Android](android.md)、[GraalVM 原生镜像](graalvm.md)、[故障排除](troubleshooting.md) |
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/security.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/security.md
index 9529476c870..89e7add5c09 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/security.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/java/security.md
@@ -52,7 +52,8 @@ Fory fory = Fory.builder()
- `withMaxUnbackedContainerItems(...)` 限制由数量驱动、但重复读取正文没有消耗相应输入的集合和映射工作。默认值为 `8192`;零表示严格限制。
- `withMaxTypeFields(...)` 和 `withMaxTypeMetaBytes(...)` 限制单个已接收远程元数据正文的字段数与编码正文大小。
- `withMaxSchemaVersionsPerType(...)` 和
- `withMaxAverageSchemaVersionsPerType(...)` 限制可接受的远程元数据版本,而不改变注册、动态加载或 Schema 演进语义。
+ `withMaxAverageSchemaVersionsPerType(...)` 限制可缓存的远程元数据版本,而不改变注册、动态加载或 Schema 演进语义。
+ 达到缓存上限后,更多有效 Schema 仍会在不缓存的情况下解码。
- `withDeserializeUnknownClass(false)` 避免根据元数据实例化未知类。
- `checkJdkClassSerializable(true)` 保留对 `java.*` 类的 JDK 可序列化性检查。
- 类注册警告可用于安全审计;需要暴露意外类型时,请使用 `suppressClassRegistrationWarnings(false)`。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/javascript/configuration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/javascript/configuration.md
index 46d00fdac37..bfb254e1369 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/javascript/configuration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/javascript/configuration.md
@@ -60,12 +60,15 @@ const fory = new Fory({
| `maxUnbackedContainerItems` | `8192` | 单次根值反序列化允许的无输入支撑集合元素和 map 条目数 |
| `maxTypeFields` | `512` | 单个已接收远程 struct 元数据主体允许的最大字段数 |
| `maxTypeMetaBytes` | `4096` | 单个已接收 TypeMeta 主体允许的最大编码主体字节数 |
-| `maxSchemaVersionsPerType` | `10` | 单个逻辑类型允许的最大远程元数据版本数 |
-| `maxAverageSchemaVersionsPerType` | `3` | 所有已接受远程类型允许的平均远程元数据版本数 |
+| `maxSchemaVersionsPerType` | `10` | 单个逻辑类型可缓存的最大缓存远程元数据版本数 |
+| `maxAverageSchemaVersionsPerType` | `3` | 所有已缓存远程类型可缓存的平均缓存远程元数据版本数 |
| `useSliceString` | `false` | 可选的 Node.js 字符串读取优化。除非已经基准测试,否则保留默认值 |
| `hps` | 未设置 | 来自 `@apache-fory/hps` 的可选快速字符串辅助模块(Node.js 20+) |
| `hooks.afterCodeGenerated` | 未设置 | 检查生成的序列化器代码的回调,适用于调试 |
+Schema 版本限制仅约束缓存的元数据。达到 Schema 版本或逻辑类型缓存上限后,有效数据仍会在完整
+元数据验证后反序列化,但不会缓存新 Schema。重复读取未缓存的 Schema 可能增加开销;既有缓存仍可复用。
+
## 引用跟踪
必须先启用全局引用跟踪,字段级引用元数据才能生效:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/javascript/security.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/javascript/security.md
index 53767488253..bd6b34dda64 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/javascript/security.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/javascript/security.md
@@ -39,7 +39,8 @@ license: |
- 将 `maxDepth` 设置为服务允许的最大嵌套深度。
- 将 `maxGraphMemoryBytes` 设为包含大量 collection、map、array、struct 和 object 的载荷的近似限制。它并非精确的堆上限;叶子值受剩余输入字节限制。
- 保持 `maxTypeFields` 和 `maxTypeMetaBytes` 的默认值,除非数据可信且可信通信方会发送更大的远程元数据。
-- 保持 `maxSchemaVersionsPerType` 和 `maxAverageSchemaVersionsPerType` 的默认值,除非数据可信且可信通信方会发送大量远程 Schema 版本。
+- 保持远程元数据大小限制的默认值,除非可信通信方需要更大的元数据。
+ Schema 版本限制只约束缓存;更多有效 Schema 会在不缓存的情况下解码。
- 对不可信输入,优先使用显式 `Type.struct(...)` Schema,而不是 `Type.any()`。
- 只传入来自与 Fory 一起部署的官方包版本的 `hps`。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/kotlin/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/kotlin/index.md
index 859cca86658..6350606bf08 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/kotlin/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/kotlin/index.md
@@ -53,14 +53,14 @@ Fory Kotlin 继承了 Fory Java 的全部功能,并增加了 Kotlin 特有优
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-kotlin</artifactId>
- <version>1.7.4</version>
+ <version>1.7.5</version>
</dependency>
```
### Gradle
```kotlin
-implementation("org.apache.fory:fory-kotlin:1.7.4")
+implementation("org.apache.fory:fory-kotlin:1.7.5")
```
### JDK25+
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/basic-serialization.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/basic-serialization.md
index 54b9679be56..c9c4d3d090a 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/basic-serialization.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/basic-serialization.md
@@ -64,6 +64,42 @@ result = fory.deserialize(data)
print(result) # Person(name='Bob', age=25, ...)
```
+## 集合接口 {#collection-interfaces}
+
+Xlang 模式接受 `collections.abc.Mapping`、`Sequence` 和 `Set` 的实现,
+包括其可变变体和虚拟子类,例如 `collections.UserDict`、`collections.UserList`、`range`
+和 `frozenset`。它们使用标准 map、list、set 编码类型,并反序列化为内置 `dict`、`list` 和 `set`。
+具体 Python 类及额外属性不会保留,也无需注册这些集合类型。
+
+```python
+from collections import UserDict, UserList
+from dataclasses import dataclass
+from typing import Mapping, Sequence
+import pyfory
+
+@dataclass
+class Scores:
+ values: Mapping[str, Sequence[int]]
+
+fory = pyfory.Fory(xlang=True)
+fory.register(Scores, name="example.Scores")
+
+value = Scores(UserDict(alice=UserList([90, 95])))
+restored = fory.loads(fory.dumps(value))
+assert restored.values == {"alice": [90, 95]}
+assert type(restored.values) is dict
+assert type(restored.values["alice"]) is list
+```
+
+支持对应的 `typing.Mapping`、`MutableMapping`、`Sequence`、`MutableSequence`、
+`AbstractSet` 和 `MutableSet` 注解,包括嵌套类型和可空元素。没有泛型参数的注解使用动态元素类型。
+字符串和二进制值保留既有编码;任意迭代器和生成器不属于集合值。
+
+普通 `list`、`set` 和 `dict` 的行为足够时,应优先使用这些值和注解,Cython 运行时有对应的专用实现。
+仅限 Python 的应用如果需要保留具体容器子类和属性,见[容器子类](native.md#container-subclasses)。
+显式自定义序列化器优先于默认集合映射。若需为 xlang 集合指定自定义类型名或 ID,
+应提供自定义序列化器并在每个通信端注册匹配的扩展。
+
## 引用跟踪与循环引用
载荷使用跨语言兼容类型时,可以安全处理重复引用:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/configuration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/configuration.md
index 049656d6a98..9b93557e050 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/configuration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/configuration.md
@@ -68,8 +68,8 @@ class ThreadSafeFory:
| `max_depth` | `int` | `50` | 安全用途的最大反序列化深度,用于防止栈溢出攻击。 |
| `max_type_fields` | `int` | `512` | 单个已接收远程结构体元数据正文可接受的最大字段数。 |
| `max_type_meta_bytes` | `int` | `4096` | 单个已接收 TypeDef 正文可接受的最大编码字节数,不含 8 字节头部和扩展长度 varint。 |
-| `max_schema_versions_per_type` | `int` | `10` | 每个逻辑类型可接受的远程元数据版本上限。 |
-| `max_average_schema_versions_per_type` | `int` | `3` | 所有已接受远程类型的平均远程元数据版本数。有效的全局下限为 `8192` 个 Schema。 |
+| `max_schema_versions_per_type` | `int` | `10` | 每个逻辑类型可缓存的远程元数据版本上限。 |
+| `max_average_schema_versions_per_type` | `int` | `3` | 所有已缓存远程类型的平均缓存远程元数据版本数。有效的全局下限为 `8192` 个 Schema。 |
| `max_graph_memory_bytes` | `int` | `134217728` | 单次根反序列化的近似对象图内存门限。显式非正值会被拒绝。 |
| `max_unbacked_container_items` | `int` | `8192` | 重复读取没有相应输入进度支撑的集合元素和映射条目的最大数量。零表示严格限制。 |
| `policy` | `DeserializationPolicy \| None` | `None` | 用于安全检查的反序列化策略。设置 `strict=False` 时强烈建议配置。 |
@@ -77,6 +77,9 @@ class ThreadSafeFory:
| `meta_compressor` | `Any` | `None` | 用于兼容模式元数据编码的可选元数据压缩器。 |
| `fory_factory` | `Callable \| None` | `None` | `ThreadSafeFory` 工厂钩子。设置后,`ThreadSafeFory` 通过该回调创建实例;否则将 `**kwargs` 转发给 `Fory` 构造过程。 |
+Schema 版本限制仅约束缓存的元数据。达到 Schema 版本或逻辑类型缓存上限后,有效数据仍会在完整
+元数据验证后反序列化,但不会缓存新 Schema。重复读取未缓存的 Schema 可能增加开销;既有缓存仍可复用。
+
## 主要方法
```python
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/native.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/native.md
index 817e3b53c75..79b882034d5 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/native.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/native.md
@@ -70,6 +70,68 @@ print(fory.loads(data)) # Person(name='Bob', age=25)
需要 pickle 风格 API 时使用 `dumps`/`loads`;在显式切换模式的代码中需要与跨语言 API 形式保持一致时,则使用 `serialize`/`deserialize`。
+## 具名元组 {#named-tuples}
+
+原生模式支持 `typing.NamedTuple` 和 `collections.namedtuple`,保留具体类及字段值。
+严格模式下,需要在每个通信端注册具名元组类型:
+
+```python
+from typing import NamedTuple
+import pyfory
+
+class Record(NamedTuple):
+ name: str
+ values: tuple
+ count: int
+
+fory = pyfory.Fory(xlang=False, strict=True)
+fory.register(Record)
+
+record = Record("sample", (1.0, 2.0, 3.0), 42)
+restored = fory.loads(fory.dumps(record))
+assert type(restored) is Record
+assert restored == record
+```
+
+写入端与读取端必须使用相同的具名元组定义,包括字段顺序。
+
+## 容器子类 {#container-subclasses}
+
+原生模式保留普通 `list`、`set` 和 `dict` 子类,包括内容、实例属性及继承的 `__slots__`。
+应在首次操作前,在两个通信端注册具体子类:
+
+```python
+import pyfory
+
+class LabeledDict(dict):
+ pass
+
+fory = pyfory.Fory(xlang=False, ref=True)
+fory.register(LabeledDict, type_id=100)
+
+value = LabeledDict(answer=42)
+value.label = "example"
+value["self"] = value
+restored = fory.loads(fory.dumps(value))
+
+assert type(restored) is LabeledDict
+assert restored.label == "example"
+assert restored["self"] is restored
+```
+
+普通子类路径不调用 `__init__`。通信两端必须使用相同的子类与 slot 定义。
+启用 `ref=True` 可保留容器内容与属性之间的共享对象和循环引用。
+
+即使重写迭代或修改方法,原生子类仍保留其基础容器存储。状态钩子在内容恢复后运行,
+因此 `__getstate__` 和 `__setstate__` 只需描述实例状态。显式自定义序列化器和自定义归约钩子优先。
+具有自定义 `__new__`、`__getnewargs__` 或 `__getnewargs_ex__` 的类需要自定义归约钩子
+或[自定义序列化器](custom-serializers.md)。`collections.abc` 接口不定义如何构造任意具体类;
+若普通对象状态或钩子无法描述完整值,应使用显式序列化器。
+
+声明为 `Mapping`、`Sequence` 或 `Set` 的字段使用集合值语义,返回内置 `dict`、`list` 或 `set`。
+需要保留 Python 类型身份与状态时,应声明已注册的具体子类或使用动态字段。
+Xlang 模式中的容器子类同样使用集合值语义,不保留 Python 专属实例状态。
+
## 安全与动态类型
原生模式可以重建会在反序列化期间执行导入和构造逻辑的 Python 对象。应像对待不可信 pickle 字节一样对待不可信原生模式字节。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/out-of-band.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/out-of-band.md
index 0e382e07401..74965df987b 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/out-of-band.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/out-of-band.md
@@ -58,6 +58,10 @@ assert np.array_equal(array, deserialized_array)
## Pandas DataFrame 带外序列化
+原生模式支持包含日期时间列和 `DatetimeIndex` 的 DataFrame,保留日期时间单位与索引元数据。
+NumPy `datetime64` 和 `timedelta64` 数组也支持此缓冲区流程。
+C 连续存储可以共享而无需复制;非连续数组会被复制。
+
```python
import pyfory
import pandas as pd
@@ -65,12 +69,13 @@ import numpy as np
fory = pyfory.Fory(xlang=False, ref=False, strict=False)
-# Create a DataFrame with numeric columns
+# Create a DataFrame with a datetime index and column
+index = pd.date_range("2026-01-01", periods=1000, freq="D", name="date")
df = pd.DataFrame({
'a': np.arange(1000, dtype=np.float64),
'b': np.arange(1000, dtype=np.int64),
- 'c': ['text'] * 1000
-})
+ 'created_at': index
+}, index=index)
# Serialize with out-of-band buffers
buffer_objects = []
@@ -80,7 +85,7 @@ buffers = [obj.getbuffer() for obj in buffer_objects]
# Deserialize
deserialized_df = fory.deserialize(serialized_data, buffers=buffers)
-assert df.equals(deserialized_df)
+pd.testing.assert_frame_equal(df, deserialized_df)
```
## 选择性带外序列化
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/security.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/security.md
index 00946d718ac..6342dd89b1a 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/security.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/python/security.md
@@ -75,12 +75,13 @@ fory = pyfory.Fory(
- `max_type_fields` 限制单个已接收结构体元数据正文可接受的字段数。
- `max_type_meta_bytes` 限制单个已接收 TypeDef 正文可接受的编码正文字节数。
-- `max_schema_versions_per_type` 限制每个逻辑类型可接受的远程元数据版本。
-- `max_average_schema_versions_per_type` 限制所有已接受远程类型的平均值。
+- `max_schema_versions_per_type` 限制每个逻辑类型可缓存的远程元数据版本。
+- `max_average_schema_versions_per_type` 限制所有已缓存远程类型的平均值。
- `max_graph_memory_bytes` 为单次根反序列化期间实例化的对象图内存设置近似门限。估算主要覆盖列表、元组、集合、字典、对象数组、结构体和 Python 对象。它会跳过字符串、二进制数据、原始标量和稠密原始类型数组等叶子值,因此实际进程内存可能高于该值。叶子值仍受字节可用性检查保护:如果未读取的输入没有足够字节,Fory 不会读取或创建该叶子值。所有根输入形式的默认值固定为 `128 MiB`。可信载荷确实需要更大或更小门限时,请设置正数字节值。
- `max_unbacked_container_items` 限制单次根反序列化中重复读取正文没有消耗相应输入的集合元素和映射条目。默认值为 `8192`;零表示严格限制。
这些限制不会改变 `strict`、`policy`、动态加载、未知类处理或 Schema 演进语义。
+达到缓存上限后,更多有效 Schema 仍会在不缓存的情况下解码。
### DeserializationPolicy
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/basic-serialization.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/basic-serialization.md
index 44f3a9f44e7..5d07b9e4334 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/basic-serialization.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/basic-serialization.md
@@ -145,7 +145,7 @@ Rust 启用 `chrono::NaiveDate`、`chrono::NaiveDateTime` 和 `chrono::Duration`
```toml
[dependencies]
-fory = { version = "1.7.4", features = ["chrono"] }
+fory = { version = "1.7.5", features = ["chrono"] }
```
### 自定义类型
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/configuration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/configuration.md
index 05c5ae3bc32..aabf1dac89d 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/configuration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/configuration.md
@@ -84,7 +84,7 @@ let fory = Fory::builder().max_dyn_depth(10).build(); // Allow up to 10 levels
### 远端 Schema 元数据限制
-兼容模式可以接收用于 Schema 演进的远端元数据。以下限制约束元数据大小和可接受的 Schema 版本:
+兼容模式可以接收用于 Schema 演进的远端元数据。以下限制约束元数据大小和可缓存的 Schema 版本:
```rust
let fory = Fory::builder()
@@ -97,8 +97,11 @@ let fory = Fory::builder()
- `max_type_fields` 默认为 `512`,限制一个已接收结构体元数据主体中的字段数。
- `max_type_meta_bytes` 默认为 `4096`,限制一个已接收 TypeDef 或 TypeMeta 主体的编码字节数,不包括 8 字节头部和任何扩展大小变长整数。
-- `max_schema_versions_per_type` 默认为 `10`,限制一个逻辑类型可接受的远端元数据版本数。
-- `max_average_schema_versions_per_type` 默认为 `3`,限制已接受远端类型的平均版本数。有效全局下限为 `8192` 个 Schema。
+- `max_schema_versions_per_type` 默认为 `10`,限制一个逻辑类型可缓存的远端元数据版本数。
+- `max_average_schema_versions_per_type` 默认为 `3`,限制已缓存远端类型的平均版本数。有效全局下限为 `8192` 个 Schema。
+
+Schema 版本限制仅约束缓存的元数据。达到 Schema 版本或逻辑类型缓存上限后,有效数据仍会在完整
+元数据验证后反序列化,但不会缓存新 Schema。重复读取未缓存的 Schema 可能增加开销;既有缓存仍可复用。
### 对象图内存预算
@@ -170,8 +173,8 @@ let fory = Fory::builder()
| `max_unbacked_container_items(usize)` | 每次根值读取允许的无输入支撑 collection/map 工作量 | `8192` |
| `max_type_fields(usize)` | 单个已接收结构体元数据主体的最大字段数 | `512` |
| `max_type_meta_bytes(usize)` | 单个已接收元数据主体的最大编码字节数 | `4096` |
-| `max_schema_versions_per_type(usize)` | 单个逻辑类型的最大远程元数据版本数 | `10` |
-| `max_average_schema_versions_per_type(usize)` | 所有类型的平均远程元数据版本数 | `3` |
+| `max_schema_versions_per_type(usize)` | 单个逻辑类型的最大缓存远程元数据版本数 | `10` |
+| `max_average_schema_versions_per_type(usize)` | 所有类型的平均缓存远程元数据版本数 | `3` |
## 兼容模式
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/index.md
index 0b87858fd4e..e8d991471fb 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/index.md
@@ -36,9 +36,9 @@ Rust 实现通过自动内存管理和编译期类型安全提供灵活的高性
| Crate | 说明 | 版本 |
| --------------------------------------------------------------------------- | ---------------------------------- | --------------------------------------------- |
-| [`fory`](https://github.com/apache/fory/blob/main/rust/fory) | 面向用户的 API、运行时类型和派生宏 | [1.7.4](https://crates.io/crates/fory) |
-| [`fory-core`](https://github.com/apache/fory/blob/main/rust/fory-core/) | 用于高级集成的底层运行时 crate | [1.7.4](https://crates.io/crates/fory-core) |
-| [`fory-derive`](https://github.com/apache/fory/blob/main/rust/fory-derive/) | 供直接使用运行时的底层过程宏 crate | [1.7.4](https://crates.io/crates/fory-derive) |
+| [`fory`](https://github.com/apache/fory/blob/main/rust/fory) | 面向用户的 API、运行时类型和派生宏 | [1.7.5](https://crates.io/crates/fory) |
+| [`fory-core`](https://github.com/apache/fory/blob/main/rust/fory-core/) | 用于高级集成的底层运行时 crate | [1.7.5](https://crates.io/crates/fory-core) |
+| [`fory-derive`](https://github.com/apache/fory/blob/main/rust/fory-derive/) | 供直接使用运行时的底层过程宏 crate | [1.7.5](https://crates.io/crates/fory-derive) |
大多数应用程序只需依赖 `fory`。它重新导出生成代码所需的派生宏和公共运行时类型。只有明确要基于底层运行时 crate 构建时,才直接使用 `fory-core` 或 `fory-derive`。
@@ -48,7 +48,7 @@ Rust 实现通过自动内存管理和编译期类型安全提供灵活的高性
```toml
[dependencies]
-fory = "1.7.4"
+fory = "1.7.5"
```
### 基本示例
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/security.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/security.md
index f078c0b018f..41504c20c72 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/security.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/rust/security.md
@@ -39,7 +39,8 @@ license: |
- 使用 `max_dyn_depth(...)` 拒绝意外过深的动态对象图。
- 对大多数输入,将 `max_graph_memory_bytes(...)` 保持为固定默认值 `128 MiB`;只有可信工作负载具有不同的合理集合、映射或结构体大小时才设置正字节限制。
- 除非可信紧凑编解码器需要更大的根限额,否则将 `max_unbacked_container_items(...)` 保持为 `8192`。零会拒绝每个无输入支撑的条目。
-- 除非数据确定无恶意且可信对等端会发送更大的元数据或大量 Schema 版本,否则请保留远端 Schema 元数据限制的默认值。
+- 保持远程元数据大小限制的默认值,除非可信通信方需要更大的元数据。
+ Schema 版本限制只约束缓存;更多有效 Schema 会在不缓存的情况下解码。
- 对不可信输入,优先使用具体类型字段,而非 `dyn Any` 或宽泛的特征对象字段。
## 验证
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/scala/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/scala/index.md
index 346142449b6..f2a783338bf 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/scala/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/scala/index.md
@@ -49,7 +49,7 @@ Fory Scala 继承了 Fory Java 的全部功能,并增加了 Scala 特有优化
使用 sbt 添加依赖:
```sbt
-libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.4"
+libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.5"
```
### JDK25+
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/swift/configuration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/swift/configuration.md
index c735ae979fc..caad0394b27 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/swift/configuration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/swift/configuration.md
@@ -111,8 +111,8 @@ array、dictionary、set、struct、class 和对象。字符串、二进制数
- `maxTypeFields` 默认为 `512`,限制单个接收的 struct 元数据主体中的字段数。
- `maxTypeMetaBytes` 默认为 `4096`,限制单个接收的 TypeMeta 主体中的编码主体字节数,不包括
8 字节头部和任何扩展大小 varint。
-- `maxSchemaVersionsPerType` 默认为 `10`,限制单个逻辑类型允许的远程元数据版本数。
-- `maxAverageSchemaVersionsPerType` 默认为 `3`,限制所有已接受远程类型的平均版本数。有效
+- `maxSchemaVersionsPerType` 默认为 `10`,限制单个逻辑类型可缓存的远程元数据版本数。
+- `maxAverageSchemaVersionsPerType` 默认为 `3`,限制所有已缓存远程类型的平均版本数。有效
全局下限为 `8192` 个 Schema。
```swift
@@ -127,6 +127,9 @@ let fory = Fory(
)
```
+Schema 版本限制仅约束缓存的元数据。达到 Schema 版本或逻辑类型缓存上限后,有效数据仍会在完整
+元数据验证后反序列化,但不会缓存新 Schema。重复读取未缓存的 Schema 可能增加开销;既有缓存仍可复用。
+
## 推荐预设
### 默认服务载荷
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/swift/security.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/swift/security.md
index 63a63c91544..a2646ca85a3 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/swift/security.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/object-serialization/swift/security.md
@@ -39,7 +39,8 @@ license: |
- 对明确采用相同 Schema 的载荷,结合 `compatible: false` 使用 `checkClassVersion`。
- 根据服务接受的最大嵌套用户值对象图设置 `maxDepth`。静态递归值、动态 `Any` 值和兼容模式字段跳过共享同一根预算。
- 使用 `maxGraphMemoryBytes` 对集合、Map、数组、结构体、类和对象密集型载荷设置近似限制。它不是精确的堆上限;叶子值由剩余输入字节限制。
-- 保持远程 Schema 元数据限制的默认值,除非数据可信,且可信对端会发送更大的元数据或大量 Schema 版本。
+- 保持远程元数据大小限制的默认值,除非可信通信方需要更大的元数据。
+ Schema 版本限制只约束缓存;更多有效 Schema 会在不缓存的情况下解码。
## 验证
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/row-format/java.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/row-format/java.md
index 0465d4d19a8..5371274add8 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/row-format/java.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/row-format/java.md
@@ -41,14 +41,14 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-format</artifactId>
- <version>1.7.4</version>
+ <version>1.7.5</version>
</dependency>
```
Gradle:
```kotlin
-implementation("org.apache.fory:fory-format:1.7.4")
+implementation("org.apache.fory:fory-format:1.7.5")
```
## 基本用法
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/specification/xlang_implementation_guide.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/specification/xlang_implementation_guide.md
index 0a65200b7c6..f7ecf0f5619 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/specification/xlang_implementation_guide.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/specification/xlang_implementation_guide.md
@@ -549,7 +549,18 @@ return result
远程 Schema 版本限制属于同一个冷元数据处理路径。头缓存命中必须跳过剩余元数据体并返回缓存元数据,不执行 Schema 限制检查、哈希重验证、分配或策略处理。协议定义的 52 位 TypeDef/TypeMeta 头哈希是唯一的 Schema 标识。当选定本地类型已经持有所接收的头时,即为本地 Schema 命中:跳过数据体并使用本地元数据,不比较字段数组或编码元数据字节,不发布到持久远程缓存,也不消耗 Schema 版本计数。此行为适用于带有元数据体的 struct 以及具名 enum、ext 和 union。头部低 12 位仅属于当前帧;命中时读取当前大小和可选扩展以检查边界并跳过,不验证当前保留位或压缩标志。低位标志验证仅属于冷未命中路径。
-头未命中时进入元数据解析路径:证明并读取元数据体字节,依据头验证数据体,验证字段数量,并通过现有注册和反序列化策略检查解析类型。若解析前尚无本地头,此仅在未命中时执行的路径可以延迟构建本地元数据,将其 52 位头哈希与已验证的接收哈希比较。哈希相等时选择本地元数据,无需比较字节或字段,也不消耗远程 Schema 版本计数。否则,检查 Schema 版本限制,构建所需读取状态,发布到持久元数据缓存,然后记录 Schema 计数。失败或不兼容的元数据不得发布到持久缓存,也不得消耗 Schema 版本计数。纯基于 ID 的 enum、ext 和 typed-union 值不携带 TypeDef 或 TypeMeta 数据体,必须保持常规 type-id 加 user-type-id 路径。兼容的具名 enum、ext 和 union 元数据通常只有一个版本,但作为共享元数据发送且发生非本地元数据未命中时,仍计入已接受的�
��程元数据总数。`maxTypeFields` 仅适用于 struct 字段列表。
+头未命中时进入元数据解析路径:证明并读取元数据体字节,依据头验证数据体,验证字段数量,
+并通过现有注册和反序列化策略检查解析类型。若解析前尚无本地头,此仅在未命中时执行的路径可以
+延迟构建本地元数据,将其 52 位头哈希与已验证的接收哈希比较。哈希相等时选择本地元数据,
+无需比较字节或字段,也不消耗远程 Schema 版本计数。
+否则,构建并验证所需的读取状态。若 Schema 版本与逻辑类型缓存配额仍有空间,则发布到持久元数据缓存,
+再记录 Schema 计数。缓存已满不会拒绝有效元数据;继续解码,但不缓存新 Schema 及其派生的序列化器和布局。
+既有元数据引用在所需生命周期内持有这些未缓存状态。根重置必须防止旧逻辑查找和跨请求累计增长;
+可复用底层槽位可以保留有界值直到被覆盖,无需立即物理清空。
+失败或不兼容的元数据不得发布到持久缓存,也不得消耗 Schema 版本计数。
+纯基于 ID 的 enum、ext 和 typed-union 值不携带 TypeDef 或 TypeMeta 数据体,
+必须保持常规 type-id 加 user-type-id 路径。兼容的具名 enum、ext 和 union 元数据通常只有一个版本,
+但在非本地元数据未命中后发布时,仍计入已缓存的远程元数据总数。`maxTypeFields` 仅适用于 struct 字段列表。
仅在未命中时使用的本地候选必须由元数据所有者在完成现有类、注册和策略检查后,根据已解码身份确定。只比较其 52 位头哈希与已验证的接收哈希。不要保留或比较元数据字节或字段,不要为重复验证而在调用链中传递额外预期类型参数,也不要增加另一套已接受头状态。缓存命中绝不重复未命中时的工作。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/specification/xlang_type_mapping.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/specification/xlang_type_mapping.md
index 799441b85d7..f55cfde2226 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/specification/xlang_type_mapping.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/specification/xlang_type_mapping.md
@@ -116,6 +116,9 @@ license: |
目标类型仍采用上表所示的 C# 映射;声明的归属方不会造成编码格式上的差异。
- Python 的 `pyfory.Float16` 和 `pyfory.BFloat16` 是预留的注解标记;标量值反序列化为 Python 原生 `float`。
- Python 的 `BoolArray`、`Int8Array`、`Int16Array`、`Int32Array`、`Int64Array`、`UInt8Array`、`UInt16Array`、`UInt32Array`、`UInt64Array`、`Float16Array`、`BFloat16Array`、`Float32Array` 和 `Float64Array` 是公开的稠密数组包装器,具有类似列表的序列行为。
+- Python 的 `collections.abc.Sequence`、`Set` 和 `Mapping` 实现及声明接口(包括可变变体)
+ 映射为 `list`、`set` 和 `map`。Xlang 读取器创建内置 Python `list`、`set` 和 `dict`;
+ Python 子类身份及实例属性不属于这些编码类型。字符串与二进制类型保留其标量/叶值映射。
- JavaScript 的 `BoolArray`、回退实现 `Float16Array` 和 `BFloat16Array` 是基于 `Uint8Array` 或 `Uint16Array` 的公开稠密数组包装器。`float16` 和 `bfloat16` 标量值使用 `number`。原生支持 `Float16Array` 的 JavaScript 环境可以为 `array<float16>` 返回该原生载体。
- Java 的 `java.util.Date` 和 `java.sql.Date` 也映射到 `timestamp`,使用秒数和纳秒数。
声明类型的字段保留其 Java 载体类型;动态时间戳使用 `Instant`。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/cpp.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/cpp.md
index 2c92b3c4bee..5c6fbfe3d8d 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/cpp.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/cpp.md
@@ -42,7 +42,7 @@ include(FetchContent)
FetchContent_Declare(
fory
GIT_REPOSITORY https://github.com/apache/fory.git
- GIT_TAG v1.7.4
+ GIT_TAG v1.7.5
SOURCE_SUBDIR cpp
)
FetchContent_MakeAvailable(fory)
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/csharp.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/csharp.md
index ace1178f76f..1c161ece6df 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/csharp.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/csharp.md
@@ -34,7 +34,7 @@ dotnet --version
```bash
dotnet new console -n ForyExample
cd ForyExample
-dotnet add package Apache.Fory --version 1.7.4
+dotnet add package Apache.Fory --version 1.7.5
```
将 `Program.cs` 替换为:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/dart.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/dart.md
index 92cbac79ade..eb309e76416 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/dart.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/dart.md
@@ -34,7 +34,7 @@ dart pub --help
```yaml
dependencies:
- fory: 1.7.4
+ fory: 1.7.5
dev_dependencies:
build_runner: ^2.4.0
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/go.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/go.md
index cd890b8e6c7..634a69f71d7 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/go.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/go.md
@@ -36,7 +36,7 @@ go env GOPROXY
mkdir fory-example
cd fory-example
go mod init example.com/fory-example
-go get github.com/apache/fory/go/fory@v1.7.4
+go get github.com/apache/fory/go/fory@v1.7.5
```
如果 Go proxy 尚未收录新的 submodule tag,请稍后重试,或者暂时使用 `GOPROXY=direct`。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/java.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/java.md
index ecbdc93b759..e3d00f161b2 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/java.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/java.md
@@ -39,14 +39,14 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-core</artifactId>
- <version>1.7.4</version>
+ <version>1.7.5</version>
</dependency>
```
Gradle:
```kotlin
-implementation("org.apache.fory:fory-core:1.7.4")
+implementation("org.apache.fory:fory-core:1.7.5")
```
运行下面完整的 xlang 往返示例:
@@ -85,7 +85,7 @@ public final class ForyExample {
Fory JSON 将 Java 对象映射为标准 JSON 文本和 UTF-8 字节。如果应用只需要 JSON,请添加 `fory-json`,无需添加 `fory-core`:
```kotlin
-implementation("org.apache.fory:fory-json:1.7.4")
+implementation("org.apache.fory:fory-json:1.7.5")
```
在 `ForyExample.java` 中添加 import:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/javascript.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/javascript.md
index 17faace8091..71b22b08f8c 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/javascript.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/javascript.md
@@ -33,7 +33,7 @@ npm --version
安装 core 软件包:
```bash
-npm install @apache-fory/core@1.7.4
+npm install @apache-fory/core@1.7.5
```
定义 Schema 并运行 xlang 往返示例:
@@ -65,7 +65,7 @@ JavaScript 使用 xlang 模式。接下来可阅读 [JavaScript/TypeScript 对
若要使用可选的 Node.js 字符串快速路径,请安装版本匹配的软件包:
```bash
-npm install @apache-fory/core@1.7.4 @apache-fory/hps@1.7.4
+npm install @apache-fory/core@1.7.5 @apache-fory/hps@1.7.5
```
## 其他能力
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/kotlin.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/kotlin.md
index 386bf872eca..9c54487c9eb 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/kotlin.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/kotlin.md
@@ -42,7 +42,7 @@ repositories {
}
dependencies {
- implementation("org.apache.fory:fory-kotlin:1.7.4")
+ implementation("org.apache.fory:fory-kotlin:1.7.5")
}
```
@@ -81,7 +81,7 @@ Fory JSON 是独立于二进制对象序列化的文本格式。与普通 JSON A
```kotlin title="build.gradle.kts"
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.4")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.5")
}
```
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/python.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/python.md
index 732da72f1e4..547a4a8a8f8 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/python.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/python.md
@@ -33,7 +33,7 @@ python -m pip --version
安装已发布的软件包:
```bash
-python -m pip install pyfory==1.7.4
+python -m pip install pyfory==1.7.5
```
运行 xlang 往返示例:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/rust.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/rust.md
index e8c6393f830..411ff063265 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/rust.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/rust.md
@@ -34,7 +34,7 @@ cargo --version
```toml title="Cargo.toml"
[dependencies]
-fory = "1.7.4"
+fory = "1.7.5"
```
```rust
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/scala.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/scala.md
index 3e0bebf256b..4ecec3308ff 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/scala.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/scala.md
@@ -35,7 +35,7 @@ sbt --version
```sbt
ThisBuild / scalaVersion := "3.3.1"
-libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.4"
+libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.7.5"
```
创建 `src/main/scala/ScalaExample.scala`:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/swift.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/swift.md
index e4726d1932c..c6ab477f053 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/swift.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/start/swift.md
@@ -39,7 +39,7 @@ swift package init --type executable --name ForyExample
```swift title="Package.swift"
dependencies: [
- .package(url: "https://github.com/apache/fory.git", exact: "1.7.4")
+ .package(url: "https://github.com/apache/fory.git", exact: "1.7.5")
],
targets: [
.executableTarget(
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/byte-array-formats-results.json b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/byte-array-formats-results.json
new file mode 100644
index 00000000000..ca2f84727dd
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/byte-array-formats-results.json
@@ -0,0 +1,625 @@
+{
+ "environment": {
+ "cpu": "Apple M4 Pro",
+ "logical_cpus": 12,
+ "os": "macOS 15.7.2 arm64",
+ "jdk": "OpenJDK 25.0.3",
+ "jmh": "1.37"
+ },
+ "source": {
+ "fory": "13739263ebf31af5fc962184aaccf2833f8ffc9a",
+ "fory_baseline": "e1d2f9d67800901392755b1133968d448ab076b8",
+ "jsoniter_scala_base": "84cb277f2c2a16b4018bc61fdeec3eed62252a1e",
+ "jsoniter_scala_adapters": "71b2ba16f1d5261e2be4e98d5dfe4be452d0e136",
+ "jsoniter_scala_version": "2.40.2-SNAPSHOT",
+ "benchmark_scala": "3.9.0",
+ "fory_scala": "3.3.8"
+ },
+ "settings": {
+ "threads": 1,
+ "forks_per_run": 1,
+ "warmup_iterations": 3,
+ "measurement_iterations": 5,
+ "iteration_seconds": 1,
+ "jvm_args": ["-Xms1g", "-Xmx1g", "-XX:+UseParallelGC"],
+ "profiler": "gc"
+ },
+ "results": [
+ {
+ "case": "ArrayOfBytesReading",
+ "size": 512,
+ "pairs": [
+ {
+ "pair": 1,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 718561.6343142863,
+ "iterations_ops_s": [
+ 720966.2774700475, 722148.059950197, 723968.2127171038,
+ 699675.4454108089, 726050.1760232744
+ ],
+ "allocation_bytes_op": 528.0081562652304,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 644154.4427726491,
+ "iterations_ops_s": [
+ 642739.6225877892, 656549.9366009792, 647274.0194844017,
+ 629323.8870815604, 644884.7481085152
+ ],
+ "allocation_bytes_op": 1128.0091134734967,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.1155114155874863
+ },
+ {
+ "pair": 2,
+ "order": ["fory", "jsoniter_scala"],
+ "fory": {
+ "throughput_ops_s": 712768.7484642493,
+ "iterations_ops_s": [
+ 715809.6255148505, 712322.2180004838, 719427.3859759014,
+ 706451.1582493099, 709833.3545807011
+ ],
+ "allocation_bytes_op": 528.0082231131366,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 646910.5376279108,
+ "iterations_ops_s": [
+ 653642.6650007655, 648076.5626362266, 639063.9666087512,
+ 648406.7871787745, 645362.7067150369
+ ],
+ "allocation_bytes_op": 1128.0090703040241,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.1018042016718836
+ },
+ {
+ "pair": 3,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 713855.8384418925,
+ "iterations_ops_s": [
+ 713930.6941047948, 699719.8311706063, 713989.776513808,
+ 721117.7876197997, 720521.1028004538
+ ],
+ "allocation_bytes_op": 528.0082200551103,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 648694.3313125791,
+ "iterations_ops_s": [
+ 640046.1536157951, 651947.475615739, 650393.8228952556,
+ 649302.6479094238, 651781.5565266822
+ ],
+ "allocation_bytes_op": 1128.0090437194845,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.100450249037115
+ }
+ ],
+ "median_fory_ops_s": 713855.8384418925,
+ "median_jsoniter_ops_s": 646910.5376279108,
+ "median_paired_ratio": 1.1018042016718836,
+ "minimum_paired_ratio": 1.100450249037115,
+ "maximum_paired_ratio": 1.1155114155874863,
+ "geometric_paired_ratio": 1.1059010882137206
+ },
+ {
+ "case": "ArrayOfBytesWriting",
+ "size": 512,
+ "pairs": [
+ {
+ "pair": 1,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 3350580.997475249,
+ "iterations_ops_s": [
+ 3354256.676965812, 3350235.8910908336, 3370583.284923328,
+ 3343149.3809342943, 3334679.7534619793
+ ],
+ "allocation_bytes_op": 1888.0017545395815,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 1534400.3964775414,
+ "iterations_ops_s": [
+ 1555002.3973013056, 1551437.3792732242, 1483784.9963905278,
+ 1539026.116856106, 1542751.092566543
+ ],
+ "allocation_bytes_op": 1888.003826423861,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 2.1836419002282828
+ },
+ {
+ "pair": 2,
+ "order": ["fory", "jsoniter_scala"],
+ "fory": {
+ "throughput_ops_s": 3355366.2425028966,
+ "iterations_ops_s": [
+ 3371208.1427841824, 3370052.5561299818, 3367852.548591301,
+ 3335320.999305273, 3332396.965703745
+ ],
+ "allocation_bytes_op": 1888.0017485208652,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 1539684.6759449516,
+ "iterations_ops_s": [
+ 1530588.7989645593, 1536345.1128779924, 1550446.53671775,
+ 1520990.2236222902, 1560052.7075421656
+ ],
+ "allocation_bytes_op": 1888.0038163834627,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 2.179255463748514
+ },
+ {
+ "pair": 3,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 3328563.302552803,
+ "iterations_ops_s": [
+ 3320520.682048541, 3331924.359155337, 3319451.2998794424,
+ 3332810.7688661655, 3338109.40281453
+ ],
+ "allocation_bytes_op": 1888.0017662799612,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 1540486.9964760381,
+ "iterations_ops_s": [
+ 1537960.3534940826, 1560478.5204790654, 1537766.2635790894,
+ 1527368.4693392226, 1538861.3754887313
+ ],
+ "allocation_bytes_op": 1888.0038109181107,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 2.1607214537786446
+ }
+ ],
+ "median_fory_ops_s": 3350580.997475249,
+ "median_jsoniter_ops_s": 1539684.6759449516,
+ "median_paired_ratio": 2.179255463748514,
+ "minimum_paired_ratio": 2.1607214537786446,
+ "maximum_paired_ratio": 2.1836419002282828,
+ "geometric_paired_ratio": 2.174516874590141
+ },
+ {
+ "case": "Base16Reading",
+ "size": 512,
+ "pairs": [
+ {
+ "pair": 1,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 3359808.747011424,
+ "iterations_ops_s": [
+ 3170890.4021431804, 2835783.848635741, 3599267.745232154,
+ 3600313.8419093373, 3592787.8971367073
+ ],
+ "allocation_bytes_op": 528.0017648087484,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 2914929.3631949537,
+ "iterations_ops_s": [
+ 2894217.0461341827, 2909705.468348089, 2928398.5845325943,
+ 2897313.7225826643, 2945011.9943772373
+ ],
+ "allocation_bytes_op": 528.0020149494615,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.1526209826672622
+ },
+ {
+ "pair": 2,
+ "order": ["fory", "jsoniter_scala"],
+ "fory": {
+ "throughput_ops_s": 3585325.1970511647,
+ "iterations_ops_s": [
+ 3606779.6047478, 3620212.096465545, 3585192.9164911993,
+ 3573313.8467803146, 3541127.5207709647
+ ],
+ "allocation_bytes_op": 528.0016362855811,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 2873552.418737786,
+ "iterations_ops_s": [
+ 2761830.775159276, 2916270.0082977437, 2909785.4844934223,
+ 2912280.347573207, 2867595.47816528
+ ],
+ "allocation_bytes_op": 528.0020441965414,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.2476978577707751
+ },
+ {
+ "pair": 3,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 3603439.30158346,
+ "iterations_ops_s": [
+ 3626219.544144616, 3602839.8185009575, 3602282.722974174,
+ 3598315.7871311214, 3587538.6351664294
+ ],
+ "allocation_bytes_op": 528.0016283749771,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 2949382.2375222584,
+ "iterations_ops_s": [
+ 2947324.1011699555, 2941788.9030553037, 2943400.2053664513,
+ 2947093.167103884, 2967304.8109156964
+ ],
+ "allocation_bytes_op": 528.001988912211,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.2217606981354399
+ }
+ ],
+ "median_fory_ops_s": 3585325.1970511647,
+ "median_jsoniter_ops_s": 2914929.3631949537,
+ "median_paired_ratio": 1.2217606981354399,
+ "minimum_paired_ratio": 1.1526209826672622,
+ "maximum_paired_ratio": 1.2476978577707751,
+ "geometric_paired_ratio": 1.2066853323390903
+ },
+ {
+ "case": "Base16Writing",
+ "size": 512,
+ "pairs": [
+ {
+ "pair": 1,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 9639285.749072284,
+ "iterations_ops_s": [
+ 9720176.667163966, 9484401.322246242, 9672723.887067826,
+ 9634169.371241517, 9684957.497641867
+ ],
+ "allocation_bytes_op": 1048.0006091523976,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 8472009.567249341,
+ "iterations_ops_s": [
+ 8479680.230866075, 8457165.337729625, 8507324.055039847,
+ 8446205.415500265, 8469672.797110893
+ ],
+ "allocation_bytes_op": 1048.0006932682013,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.137780319127039
+ },
+ {
+ "pair": 2,
+ "order": ["fory", "jsoniter_scala"],
+ "fory": {
+ "throughput_ops_s": 9790192.385472855,
+ "iterations_ops_s": [
+ 9729910.203410858, 9798489.073830001, 9801086.328943448,
+ 9821711.761606097, 9799764.559573878
+ ],
+ "allocation_bytes_op": 1048.0005986565332,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 8444372.230910677,
+ "iterations_ops_s": [
+ 8454419.247091914, 8498853.198057437, 8439041.593527095,
+ 8413092.78031926, 8416454.335557679
+ ],
+ "allocation_bytes_op": 1048.0006945067705,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.159374802266034
+ },
+ {
+ "pair": 3,
+ "order": ["jsoniter_scala", "fory"],
+ "fory": {
+ "throughput_ops_s": 9627140.75202604,
+ "iterations_ops_s": [
+ 9571136.694928922, 9670291.685970405, 9650637.061303275,
+ 9649359.818529114, 9594278.499398485
+ ],
+ "allocation_bytes_op": 1048.0006093169627,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 8299340.122327629,
+ "iterations_ops_s": [
+ 8304739.0318363365, 8098181.555887745, 8329959.2642635,
+ 8378818.139460061, 8385002.620190503
+ ],
+ "allocation_bytes_op": 1048.0007070897,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "throughput_ratio": 1.1599886991167216
+ }
+ ],
+ "median_fory_ops_s": 9639285.749072284,
+ "median_jsoniter_ops_s": 8444372.230910677,
+ "median_paired_ratio": 1.159374802266034,
+ "minimum_paired_ratio": 1.137780319127039,
+ "maximum_paired_ratio": 1.1599886991167216,
+ "geometric_paired_ratio": 1.1523347999694993
+ }
+ ],
+ "numeric_read_development_pairs": [
+ {
+ "pair": 1,
+ "measurement_iterations": 3,
+ "baseline": {
+ "throughput_ops_s": 532673.8573387515,
+ "iterations_ops_s": [
+ 525513.9417793049, 542316.8084152596, 530190.8218216901
+ ],
+ "allocation_bytes_op": 1656.0110539563302,
+ "artifact_sha256": {
+ "fory_json": "0b175646200572bd67817e5ff6350ca9b41ecf8d9c5fedb46ef90677fe335014",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "fory": {
+ "throughput_ops_s": 688445.4281281951,
+ "iterations_ops_s": [
+ 661077.1182975627, 700984.16167637, 703275.0044106527
+ ],
+ "allocation_bytes_op": 528.0085360717871,
+ "artifact_sha256": {
+ "fory_json": "3dc8c8cce674855b39faca03156bf57048bb28d1503513cd5d5a85c6935ea696",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 633958.6015719158,
+ "iterations_ops_s": [
+ 617689.5090250478, 649548.5363109286, 634637.7593797712
+ ],
+ "allocation_bytes_op": 1128.0092592375615,
+ "artifact_sha256": {
+ "fory_json": "0b175646200572bd67817e5ff6350ca9b41ecf8d9c5fedb46ef90677fe335014",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ }
+ },
+ {
+ "pair": 2,
+ "measurement_iterations": 3,
+ "baseline": {
+ "throughput_ops_s": 540338.0918875013,
+ "iterations_ops_s": [
+ 536275.7264876695, 526926.7419483826, 557811.8072264518
+ ],
+ "allocation_bytes_op": 1656.0108723773349,
+ "artifact_sha256": {
+ "fory_json": "0b175646200572bd67817e5ff6350ca9b41ecf8d9c5fedb46ef90677fe335014",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "fory": {
+ "throughput_ops_s": 720624.0504748118,
+ "iterations_ops_s": [
+ 725308.188246871, 717928.044117385, 718635.9190601795
+ ],
+ "allocation_bytes_op": 528.0081332921432,
+ "artifact_sha256": {
+ "fory_json": "3dc8c8cce674855b39faca03156bf57048bb28d1503513cd5d5a85c6935ea696",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "jsoniter_scala": {
+ "throughput_ops_s": 637647.9827981751,
+ "iterations_ops_s": [
+ 633147.7919315896, 637860.5415264402, 641935.6149364957
+ ],
+ "allocation_bytes_op": 1128.0092273109979,
+ "artifact_sha256": {
+ "fory_json": "0b175646200572bd67817e5ff6350ca9b41ecf8d9c5fedb46ef90677fe335014",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ }
+ }
+ ],
+ "integer_read_control": [
+ {
+ "pair": 1,
+ "baseline": {
+ "throughput_ops_s": 491577.15519360424,
+ "iterations_ops_s": [
+ 493226.1424904787, 487426.7022866886, 491108.85466615774,
+ 489525.76150114706, 496598.3150235495
+ ],
+ "allocation_bytes_op": 4176.011942924268,
+ "artifact_sha256": {
+ "fory_json": "0b175646200572bd67817e5ff6350ca9b41ecf8d9c5fedb46ef90677fe335014",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "fory": {
+ "throughput_ops_s": 498496.5149580714,
+ "iterations_ops_s": [
+ 500744.575380113, 500638.4030852225, 493489.2902459867,
+ 498268.2111324434, 499342.09494659153
+ ],
+ "allocation_bytes_op": 4176.011777540917,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ }
+ },
+ {
+ "pair": 2,
+ "baseline": {
+ "throughput_ops_s": 487399.4866039612,
+ "iterations_ops_s": [
+ 492882.917488924, 491449.6032085084, 492271.10849723214,
+ 483111.02830760553, 477282.77551753627
+ ],
+ "allocation_bytes_op": 4176.012066509457,
+ "artifact_sha256": {
+ "fory_json": "0b175646200572bd67817e5ff6350ca9b41ecf8d9c5fedb46ef90677fe335014",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ },
+ "fory": {
+ "throughput_ops_s": 492338.3696801558,
+ "iterations_ops_s": [
+ 482311.38343038387, 493766.54553907254, 493700.9130787423,
+ 495583.89678214624, 496329.1095704343
+ ],
+ "allocation_bytes_op": 4176.01193743859,
+ "artifact_sha256": {
+ "fory_json": "a60312c784247481c49a6a7a2bf128979fdba070c305a0e1f95966673237883b",
+ "fory_scala": "69bce71e74891f86f0a2b1a607b2a86743955e5378386dbc3ab72e64c30f62cd",
+ "fory_core": "1d743236d0529f1e0c082bba9abc36bf502167add84905441ad917f7143b5b9a",
+ "benchmark": "606d03f7f6fb4bbf217b3e2d30ae82054d702aa937148328b1987191bd63e3b4"
+ }
+ }
+ }
+ ]
+}
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/byte-array-formats.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/byte-array-formats.md
new file mode 100644
index 00000000000..ac69cd0eac4
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/byte-array-formats.md
@@ -0,0 +1,92 @@
+# JVM JSON 字节数组格式测量
+
+本次对比使用未修改的 jsoniter-scala `ArrayOfBytesReading`、`ArrayOfBytesWriting`、
+`Base16Reading` 和 `Base16Writing` 工作负载,参数为 `size=512`,覆盖数字字节数组和 Base16 字符串。
+吞吐量越高越好。
+
+最终 12 组相邻配对对比的提升均超过 10%。数字数组读取的余量较小,最小提升为 10.05%。
+这些是本地稳态测量,不保证其他大小、数据分布、机器或 JVM 上的结果。
+
+## 结果
+
+| 工作负载 | jsoniter-scala 中位数,ops/s | Fory 中位数,ops/s | 配对提升中位数 | 配对范围 |
+| ---------------- | ---------------------------: | -----------------: | -------------: | -------------------: |
+| 数字字节数组读取 | 646,911 | 713,856 | +10.18% | +10.05% 至 +11.55% |
+| 数字字节数组写入 | 1,539,685 | 3,350,581 | +117.93% | +116.07% 至 +118.36% |
+| Base16 读取 | 2,914,929 | 3,585,325 | +22.18% | +15.26% 至 +24.77% |
+| Base16 写入 | 8,444,372 | 9,639,286 | +15.94% | +13.78% 至 +16.00% |
+
+每组配对比较五轮测量迭代的均值。提升列是配对比值的中位数,不是两个独立中位数之比。
+保留全部最终样本。较早、较短的数字数组读取对比分别测得 +8.59% 和 +13.01%,也保留在证据中,
+说明不能将最终的小幅余量推广到其他环境。
+
+Fory 数字数组读取每次操作分配约 528 B,jsoniter-scala 约 1,128 B。
+数字数组输出两者均约 1,888 B,Base16 输入约 528 B,Base16 输出约 1,048 B。
+两者均使用返回独立数组的 API,不使用预分配输出的基准测试。
+这些稳态分配数据不包含启动及保留的查找表内存;Fory 的 Base16 输出表在首次使用后占用 256 KiB。
+
+受影响的整数读取路径还与优化前的 Fory 版本做了两组相邻配对比较,变化为 +1.41% 和 +1.01%,
+处于通常视为噪声的范围;这些运行中未观察到回退。
+
+[迭代样本、分配量、配对结果及制品哈希](byte-array-formats-results.json)以 JSON 提供。
+
+## 工作负载与配置
+
+输入字节为基准测试原有的 `(1 to size).map(_.toByte).toArray` 序列。
+数字数组保留原有有符号十进制 JSON 表示,Base16 保留原有小写十六进制字符串。
+模型、输入、期望输出和 jsoniter-scala 实现均未修改,只启用了缺失的 Fory 适配器及其已有正确性规格。
+
+Fory 使用通过公共 builder 分别配置的实例:
+
+```java
+import org.apache.fory.json.ForyJson;
+import org.apache.fory.json.annotation.JsonByteArray;
+
+ForyJson arrays = ForyJson.builder().byteArrayFormat(JsonByteArray.Format.ARRAY).build();
+ForyJson hex = ForyJson.builder().byteArrayFormat(JsonByteArray.Format.BASE16).build();
+```
+
+读取适配器调用 `fromJson(jsonBytes, classOf[Array[Byte]])`,写入适配器调用 `toJsonBytes(obj)`。
+这些配置也适用于嵌套字节数组,不是基准测试专用编解码器。
+
+## 环境与版本
+
+- 日期:2026 年 9 月 21 日。
+- Apple M4 Pro,12 个逻辑 CPU,48 GiB RAM;macOS 15.7.2 arm64。
+- OpenJDK 25.0.3;JMH 1.37。
+- Fory:`13739263ebf31af5fc962184aaccf2833f8ffc9a`,版本 `1.8.0-SNAPSHOT`。
+- Fory 优化前基线:`e1d2f9d67800901392755b1133968d448ab076b8`。
+- jsoniter-scala:`2.40.2-SNAPSHOT`,检出版本 `71b2ba16f1d5261e2be4e98d5dfe4be452d0e136`;
+ Fory 适配器新增内容基于 `84cb277f2c2a16b4018bc61fdeec3eed62252a1e`。
+- 基准测试 Scala:3.9.0;Fory JSON Scala:3.3.8。
+- 每次运行一个线程和一个 fork;三轮 1 秒预热、五轮 1 秒测量;
+ `-Xms1g -Xmx1g -XX:+UseParallelGC`;JMH GC profiler。
+- 每个工作负载三组相邻配对,顺序为 jsoniter/Fory、Fory/jsoniter、jsoniter/Fory。
+ 所有运行串行进行,保留日常桌面后台活动。
+
+测量期间 runtime、core、Scala 和基准测试 jar 固定不变。
+基线/当前版本对照中只替换 Fory JSON runtime jar。
+
+## 复现
+
+构建基准测试 assembly 前,先安装 Fory core、JSON 和 JSON Scala 制品。
+使用本地发布的快照时启用 Maven Local:
+
+```bash
+sbt --java-home "$JAVA_HOME" \
+ 'set ThisBuild / resolvers += Resolver.mavenLocal' \
+ '++3.9.0!' 'jsoniter-scala-benchmarkJVM/assembly'
+```
+
+每个方法在独立进程中运行,并在配对之间交替库的执行顺序。两个方法使用同一固定 classpath:
+
+```bash
+java -cp "$FORY_JSON_JAR:$FORY_SCALA_JAR:$FORY_CORE_JAR:$BENCHMARK_JAR" \
+ org.openjdk.jmh.Main ".*\.${CASE}\.${METHOD}$" \
+ -t 1 -f 1 -wi 3 -i 5 -w 1s -r 1s -p size=512 \
+ -jvmArgs '-Xms1g -Xmx1g -XX:+UseParallelGC' -foe true -prof gc \
+ -rf json -rff "$RESULT_FILE"
+```
+
+`CASE` 为上述四个工作负载之一,`METHOD` 为 `fory` 或 `jsoniterScala`。
+这里没有测量 GraalVM 或原生镜像性能。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/pretty-printing-results.json b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/pretty-printing-results.json
new file mode 100644
index 00000000000..a09d6652547
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/pretty-printing-results.json
@@ -0,0 +1,2023 @@
+{
+ "date": "2026-09-21",
+ "foryCommit": "2b8af43f17c98633538594ab6ff942591728c0a4",
+ "foryBaseCommit": "509a096aa3ac68c0ca9ee248d085db7855523584",
+ "jsoniterBenchmarkCommit": "84cb277f2c2a16b4018bc61fdeec3eed62252a1e",
+ "environment": {
+ "os": "macOS 15.7.2 arm64",
+ "cpu": "Apple M4 Pro, 12 cores",
+ "memory": "48 GiB",
+ "jdk": "OpenJDK 25.0.3",
+ "jmh": "1.37",
+ "forksPerRun": 1,
+ "threads": 1,
+ "warmup": "3 x 1 s",
+ "measurement": "5 x 1 s",
+ "jvmArgs": "-Xms1g -Xmx1g -XX:+UseParallelGC",
+ "profiler": "gc",
+ "scalaBenchmark": "3.9.0",
+ "foryScala": "3.3.8",
+ "jsoniterScala": "2.40.2-SNAPSHOT"
+ },
+ "excludedPairs": [],
+ "artifactsSha256": {
+ "baseline-json.jar": "2cc53b28789886cd90be42d5c8a0caf2e16194a8b3a0c66754d73189e814932b",
+ "final-json.jar": "f1399c6a49e058be3a41928ca4960df968cda6626aa612fb9e218926533923d0",
+ "core.jar": "0dab0425a62469728075f0d49266c3ba636fdc8395ac2fe16cea0a54a6a40b7d",
+ "media-benchmarks.jar": "c164be3939b43782dbd5ee53ecbd4b9eca24c54f0e7e6671c396403c6ac3651c",
+ "write-scala.jar": "0398701d14d2068ccfbae6bd5a25c12f0e3acabfeee969260bea9d5bf0ae70f2",
+ "write-pretty-benchmarks.jar": "b6783c0f0d9ee9438e9ee073b558b92ddd66ad59f9b4c43ac9bfba77ca1b700c"
+ },
+ "results": [
+ {
+ "case": "MediaContent compact String",
+ "pairs": [
+ {
+ "pair": 1,
+ "baseline": 7740542.2410122575,
+ "current": 8586305.864112541,
+ "changePercent": 10.926413121539657,
+ "bytesPerOp": {
+ "baseline": 528.0007576294123,
+ "current": 528.0006836341037
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-string-1-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 7740542.2410122575,
+ "scoreError": 96749.01386114674,
+ "scoreConfidence": [
+ 7643793.227151111,
+ 7837291.254873404
+ ],
+ "scorePercentiles": {
+ "0.0": 7696272.997603743,
+ "50.0": 7747804.599157845,
+ "90.0": 7756392.0909042545,
+ "95.0": 7756392.0909042545,
+ "99.0": 7756392.0909042545,
+ "99.9": 7756392.0909042545,
+ "99.99": 7756392.0909042545,
+ "99.999": 7756392.0909042545,
+ "99.9999": 7756392.0909042545,
+ "100.0": 7756392.0909042545
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 7756392.0909042545,
+ 7746784.304379124,
+ 7755457.213016323,
+ 7747804.599157845,
+ 7696272.997603743
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007576294123,
+ "scoreError": 7.68600918906523e-06,
+ "scoreConfidence": [
+ 528.0007499434031,
+ 528.0007653154215
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0007561237613,
+ "50.0": 528.0007568826769,
+ "90.0": 528.0007611279741,
+ "95.0": 528.0007611279741,
+ "99.0": 528.0007611279741,
+ "99.9": 528.0007611279741,
+ "99.99": 528.0007611279741,
+ "99.999": 528.0007611279741,
+ "99.9999": 528.0007611279741,
+ "100.0": 528.0007611279741
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0007568826769,
+ 528.0007567877292,
+ 528.0007572249199,
+ 528.0007561237613,
+ 528.0007611279741
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-string-1-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8586305.864112541,
+ "scoreError": 48705.60277143552,
+ "scoreConfidence": [
+ 8537600.261341106,
+ 8635011.466883976
+ ],
+ "scorePercentiles": {
+ "0.0": 8567839.209879762,
+ "50.0": 8590959.961186854,
+ "90.0": 8600779.581412775,
+ "95.0": 8600779.581412775,
+ "99.0": 8600779.581412775,
+ "99.9": 8600779.581412775,
+ "99.99": 8600779.581412775,
+ "99.999": 8600779.581412775,
+ "99.9999": 8600779.581412775,
+ "100.0": 8600779.581412775
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8567839.209879762,
+ 8600779.581412775,
+ 8591787.877058808,
+ 8590959.961186854,
+ 8580162.691024503
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0006836341037,
+ "scoreError": 5.727016778031646e-06,
+ "scoreConfidence": [
+ 528.0006779070869,
+ 528.0006893611204
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006819186514,
+ "50.0": 528.0006834049817,
+ "90.0": 528.0006859854044,
+ "95.0": 528.0006859854044,
+ "99.0": 528.0006859854044,
+ "99.9": 528.0006859854044,
+ "99.99": 528.0006859854044,
+ "99.999": 528.0006859854044,
+ "99.9999": 528.0006859854044,
+ "100.0": 528.0006859854044
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0006837782324,
+ 528.0006830832484,
+ 528.0006834049817,
+ 528.0006819186514,
+ 528.0006859854044
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 2,
+ "baseline": 8340276.573981364,
+ "current": 8270848.431381231,
+ "changePercent": -0.832444128012777,
+ "bytesPerOp": {
+ "baseline": 528.0007033340469,
+ "current": 528.0007100246951
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-string-2-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8340276.573981364,
+ "scoreError": 151887.47725277377,
+ "scoreConfidence": [
+ 8188389.09672859,
+ 8492164.051234137
+ ],
+ "scorePercentiles": {
+ "0.0": 8297797.043594185,
+ "50.0": 8334095.375718523,
+ "90.0": 8387051.174751796,
+ "95.0": 8387051.174751796,
+ "99.0": 8387051.174751796,
+ "99.9": 8387051.174751796,
+ "99.99": 8387051.174751796,
+ "99.999": 8387051.174751796,
+ "99.9999": 8387051.174751796,
+ "100.0": 8387051.174751796
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8387051.174751796,
+ 8374319.307731112,
+ 8334095.375718523,
+ 8297797.043594185,
+ 8308119.968111208
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007033340469,
+ "scoreError": 1.3587301360531053e-05,
+ "scoreConfidence": [
+ 528.0006897467455,
+ 528.0007169213483
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006995739703,
+ "50.0": 528.0007029522802,
+ "90.0": 528.0007071252477,
+ "95.0": 528.0007071252477,
+ "99.0": 528.0007071252477,
+ "99.9": 528.0007071252477,
+ "99.99": 528.0007071252477,
+ "99.999": 528.0007071252477,
+ "99.9999": 528.0007071252477,
+ "100.0": 528.0007071252477
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0007002624557,
+ 528.0006995739703,
+ 528.0007029522802,
+ 528.0007067562804,
+ 528.0007071252477
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-string-2-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8270848.431381231,
+ "scoreError": 129232.42012433802,
+ "scoreConfidence": [
+ 8141616.011256893,
+ 8400080.85150557
+ ],
+ "scorePercentiles": {
+ "0.0": 8224806.498983829,
+ "50.0": 8266049.8177848235,
+ "90.0": 8311198.038799844,
+ "95.0": 8311198.038799844,
+ "99.0": 8311198.038799844,
+ "99.9": 8311198.038799844,
+ "99.99": 8311198.038799844,
+ "99.999": 8311198.038799844,
+ "99.9999": 8311198.038799844,
+ "100.0": 8311198.038799844
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8311198.038799844,
+ 8266049.8177848235,
+ 8294525.162445205,
+ 8224806.498983829,
+ 8257662.638892452
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007100246951,
+ "scoreError": 2.0539582223100004e-05,
+ "scoreConfidence": [
+ 528.0006894851128,
+ 528.0007305642773
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0007015048812,
+ "50.0": 528.0007104226532,
+ "90.0": 528.000716151181,
+ "95.0": 528.000716151181,
+ "99.0": 528.000716151181,
+ "99.9": 528.000716151181,
+ "99.99": 528.000716151181,
+ "99.999": 528.000716151181,
+ "99.9999": 528.000716151181,
+ "100.0": 528.000716151181
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0007015048812,
+ 528.0007118995312,
+ 528.0007101452283,
+ 528.000716151181,
+ 528.0007104226532
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 3,
+ "baseline": 8619720.172416156,
+ "current": 8401210.110169353,
+ "changePercent": -2.535001808365589,
+ "bytesPerOp": {
+ "baseline": 528.0006807328953,
+ "current": 528.0006997464873
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-string-3-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8619720.172416156,
+ "scoreError": 131888.2740701128,
+ "scoreConfidence": [
+ 8487831.898346044,
+ 8751608.446486268
+ ],
+ "scorePercentiles": {
+ "0.0": 8567976.49947435,
+ "50.0": 8623953.571467672,
+ "90.0": 8655059.642564042,
+ "95.0": 8655059.642564042,
+ "99.0": 8655059.642564042,
+ "99.9": 8655059.642564042,
+ "99.99": 8655059.642564042,
+ "99.999": 8655059.642564042,
+ "99.9999": 8655059.642564042,
+ "100.0": 8655059.642564042
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8655059.642564042,
+ 8644166.442103568,
+ 8607444.70647115,
+ 8623953.571467672,
+ 8567976.49947435
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0006807328953,
+ "scoreError": 1.3389564671490564e-05,
+ "scoreConfidence": [
+ 528.0006673433306,
+ 528.0006941224599
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006777369066,
+ "50.0": 528.0006795373283,
+ "90.0": 528.0006866702928,
+ "95.0": 528.0006866702928,
+ "99.0": 528.0006866702928,
+ "99.9": 528.0006866702928,
+ "99.99": 528.0006866702928,
+ "99.999": 528.0006866702928,
+ "99.9999": 528.0006866702928,
+ "100.0": 528.0006866702928
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0006790910652,
+ 528.0006777369066,
+ 528.0006806288835,
+ 528.0006795373283,
+ 528.0006866702928
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-string-3-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8401210.110169353,
+ "scoreError": 1152711.9079017532,
+ "scoreConfidence": [
+ 7248498.2022676,
+ 9553922.018071106
+ ],
+ "scorePercentiles": {
+ "0.0": 7877331.732185825,
+ "50.0": 8479509.432548821,
+ "90.0": 8614641.772121916,
+ "95.0": 8614641.772121916,
+ "99.0": 8614641.772121916,
+ "99.9": 8614641.772121916,
+ "99.99": 8614641.772121916,
+ "99.999": 8614641.772121916,
+ "99.9999": 8614641.772121916,
+ "100.0": 8614641.772121916
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8479509.432548821,
+ 7877331.732185825,
+ 8465435.306014046,
+ 8569132.307976156,
+ 8614641.772121916
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0006997464873,
+ "scoreError": 9.672280303942653e-05,
+ "scoreConfidence": [
+ 528.0006030236842,
+ 528.0007964692903
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006816496059,
+ "50.0": 528.000691503886,
+ "90.0": 528.0007431273343,
+ "95.0": 528.0007431273343,
+ "99.0": 528.0007431273343,
+ "99.9": 528.0007431273343,
+ "99.99": 528.0007431273343,
+ "99.999": 528.0007431273343,
+ "99.9999": 528.0007431273343,
+ "100.0": 528.0007431273343
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.000691503886,
+ 528.0007431273343,
+ 528.0006983404976,
+ 528.0006841111127,
+ 528.0006816496059
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 4,
+ "baseline": 8427212.62617099,
+ "current": 8127303.694033952,
+ "changePercent": -3.5588152980222665,
+ "bytesPerOp": {
+ "baseline": 528.0006960425264,
+ "current": 528.0007225841354
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-string-4-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8427212.62617099,
+ "scoreError": 145480.17619138976,
+ "scoreConfidence": [
+ 8281732.4499796,
+ 8572692.802362379
+ ],
+ "scorePercentiles": {
+ "0.0": 8370071.391779255,
+ "50.0": 8434549.150815213,
+ "90.0": 8474713.930924766,
+ "95.0": 8474713.930924766,
+ "99.0": 8474713.930924766,
+ "99.9": 8474713.930924766,
+ "99.99": 8474713.930924766,
+ "99.999": 8474713.930924766,
+ "99.9999": 8474713.930924766,
+ "100.0": 8474713.930924766
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8436474.97403194,
+ 8370071.391779255,
+ 8420253.683303768,
+ 8474713.930924766,
+ 8434549.150815213
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0006960425264,
+ "scoreError": 1.1438363931649776e-05,
+ "scoreConfidence": [
+ 528.0006846041625,
+ 528.0007074808904
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006925492847,
+ "50.0": 528.0006948096843,
+ "90.0": 528.0006998763212,
+ "95.0": 528.0006998763212,
+ "99.0": 528.0006998763212,
+ "99.9": 528.0006998763212,
+ "99.99": 528.0006998763212,
+ "99.999": 528.0006998763212,
+ "99.9999": 528.0006998763212,
+ "100.0": 528.0006998763212
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0006948096843,
+ 528.0006998763212,
+ 528.0006982882451,
+ 528.0006925492847,
+ 528.0006946890971
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-string-4-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8127303.694033952,
+ "scoreError": 250619.82680084393,
+ "scoreConfidence": [
+ 7876683.867233109,
+ 8377923.520834796
+ ],
+ "scorePercentiles": {
+ "0.0": 8062624.351807092,
+ "50.0": 8106339.79964073,
+ "90.0": 8198662.237340811,
+ "95.0": 8198662.237340811,
+ "99.0": 8198662.237340811,
+ "99.9": 8198662.237340811,
+ "99.99": 8198662.237340811,
+ "99.999": 8198662.237340811,
+ "99.9999": 8198662.237340811,
+ "100.0": 8198662.237340811
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8074749.520948258,
+ 8062624.351807092,
+ 8194142.56043287,
+ 8106339.79964073,
+ 8198662.237340811
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007225841354,
+ "scoreError": 2.100344242308327e-05,
+ "scoreConfidence": [
+ 528.000701580693,
+ 528.0007435875777
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0007153652882,
+ "50.0": 528.0007242188602,
+ "90.0": 528.0007281948435,
+ "95.0": 528.0007281948435,
+ "99.0": 528.0007281948435,
+ "99.9": 528.0007281948435,
+ "99.99": 528.0007281948435,
+ "99.999": 528.0007281948435,
+ "99.9999": 528.0007281948435,
+ "100.0": 528.0007281948435
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0007281948435,
+ 528.0007266170129,
+ 528.0007185246717,
+ 528.0007242188602,
+ 528.0007153652882
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 5,
+ "baseline": 8611432.323329074,
+ "current": 7946838.377878162,
+ "changePercent": -7.717577291416122,
+ "bytesPerOp": {
+ "baseline": 528.0006811587577,
+ "current": 528.0007422158081
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-string-5-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8611432.323329074,
+ "scoreError": 179664.85057322503,
+ "scoreConfidence": [
+ 8431767.47275585,
+ 8791097.1739023
+ ],
+ "scorePercentiles": {
+ "0.0": 8554619.520131975,
+ "50.0": 8619506.760627687,
+ "90.0": 8676759.122702036,
+ "95.0": 8676759.122702036,
+ "99.0": 8676759.122702036,
+ "99.9": 8676759.122702036,
+ "99.99": 8676759.122702036,
+ "99.999": 8676759.122702036,
+ "99.9999": 8676759.122702036,
+ "100.0": 8676759.122702036
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8625609.776898941,
+ 8619506.760627687,
+ 8676759.122702036,
+ 8580666.43628473,
+ 8554619.520131975
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0006811587577,
+ "scoreError": 1.5038097793554097e-05,
+ "scoreConfidence": [
+ 528.00066612066,
+ 528.0006961968555
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006759201606,
+ "50.0": 528.0006799131171,
+ "90.0": 528.0006852616034,
+ "95.0": 528.0006852616034,
+ "99.0": 528.0006852616034,
+ "99.9": 528.0006852616034,
+ "99.99": 528.0006852616034,
+ "99.999": 528.0006852616034,
+ "99.9999": 528.0006852616034,
+ "100.0": 528.0006852616034
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0006799131171,
+ 528.0006798651493,
+ 528.0006759201606,
+ 528.0006852616034,
+ 528.0006848337586
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-string-5-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 7946838.377878162,
+ "scoreError": 2194483.360735558,
+ "scoreConfidence": [
+ 5752355.017142604,
+ 10141321.738613721
+ ],
+ "scorePercentiles": {
+ "0.0": 6941338.09254342,
+ "50.0": 8186504.00016715,
+ "90.0": 8287543.913178998,
+ "95.0": 8287543.913178998,
+ "99.0": 8287543.913178998,
+ "99.9": 8287543.913178998,
+ "99.99": 8287543.913178998,
+ "99.999": 8287543.913178998,
+ "99.9999": 8287543.913178998,
+ "100.0": 8287543.913178998
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8186504.00016715,
+ 8287543.913178998,
+ 8269465.644650462,
+ 8049340.238850774,
+ 6941338.09254342
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007422158081,
+ "scoreError": 0.0002206687717830692,
+ "scoreConfidence": [
+ 528.0005215470363,
+ 528.00096288458
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0007085973023,
+ "50.0": 528.0007155951618,
+ "90.0": 528.0008439735444,
+ "95.0": 528.0008439735444,
+ "99.0": 528.0008439735444,
+ "99.9": 528.0008439735444,
+ "99.99": 528.0008439735444,
+ "99.999": 528.0008439735444,
+ "99.9999": 528.0008439735444,
+ "100.0": 528.0008439735444
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0007155951618,
+ 528.0007085973023,
+ 528.0007150939914,
+ 528.000727819041,
+ 528.0008439735444
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 6,
+ "baseline": 8232438.287890455,
+ "current": 7953841.748397452,
+ "changePercent": -3.3841315264130922,
+ "bytesPerOp": {
+ "baseline": 528.0007166503547,
+ "current": 528.0007394894826
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-string-6-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 8232438.287890455,
+ "scoreError": 2055642.6962622763,
+ "scoreConfidence": [
+ 6176795.591628179,
+ 10288080.98415273
+ ],
+ "scorePercentiles": {
+ "0.0": 7281388.97456578,
+ "50.0": 8426476.903670084,
+ "90.0": 8529499.40494271,
+ "95.0": 8529499.40494271,
+ "99.0": 8529499.40494271,
+ "99.9": 8529499.40494271,
+ "99.99": 8529499.40494271,
+ "99.999": 8529499.40494271,
+ "99.9999": 8529499.40494271,
+ "100.0": 8529499.40494271
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8505940.41181416,
+ 8529499.40494271,
+ 8418885.74445954,
+ 8426476.903670084,
+ 7281388.97456578
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007166503547,
+ "scoreError": 0.00020715927416057185,
+ "scoreConfidence": [
+ 528.0005094910805,
+ 528.0009238096288
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0006849905539,
+ "50.0": 528.0006990178916,
+ "90.0": 528.0008121622393,
+ "95.0": 528.0008121622393,
+ "99.0": 528.0008121622393,
+ "99.9": 528.0008121622393,
+ "99.99": 528.0008121622393,
+ "99.999": 528.0008121622393,
+ "99.9999": 528.0008121622393,
+ "100.0": 528.0008121622393
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0006849905539,
+ 528.0006874880102,
+ 528.0006995930779,
+ 528.0006990178916,
+ 528.0008121622393
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-string-6-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonString",
+ "primaryMetric": {
+ "score": 7953841.748397452,
+ "scoreError": 1345044.7604454085,
+ "scoreConfidence": [
+ 6608796.987952043,
+ 9298886.50884286
+ ],
+ "scorePercentiles": {
+ "0.0": 7329721.641001762,
+ "50.0": 8095479.840009848,
+ "90.0": 8136056.841994592,
+ "95.0": 8136056.841994592,
+ "99.0": 8136056.841994592,
+ "99.9": 8136056.841994592,
+ "99.99": 8136056.841994592,
+ "99.999": 8136056.841994592,
+ "99.9999": 8136056.841994592,
+ "100.0": 8136056.841994592
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 8094409.212949782,
+ 8095479.840009848,
+ 8113541.206031276,
+ 8136056.841994592,
+ 7329721.641001762
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 528.0007394894826,
+ "scoreError": 0.00012919281505005892,
+ "scoreConfidence": [
+ 528.0006102966676,
+ 528.0008686822977
+ ],
+ "scorePercentiles": {
+ "0.0": 528.0007212051966,
+ "50.0": 528.0007254617611,
+ "90.0": 528.0007992533062,
+ "95.0": 528.0007992533062,
+ "99.0": 528.0007992533062,
+ "99.9": 528.0007992533062,
+ "99.99": 528.0007992533062,
+ "99.999": 528.0007992533062,
+ "99.9999": 528.0007992533062,
+ "100.0": 528.0007992533062
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 528.0007291592252,
+ 528.0007254617611,
+ 528.000722367924,
+ 528.0007212051966,
+ 528.0007992533062
+ ]
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "medianBaseline": 8383744.600076176,
+ "medianCurrent": 8199076.062707592,
+ "medianChangePercent": -2.959566667389341,
+ "geometricMeanChangePercent": -1.3461873082022837,
+ "lower95ChangePercent": -6.265287411205402
+ },
+ {
+ "case": "MediaContent compact UTF-8",
+ "pairs": [
+ {
+ "pair": 1,
+ "baseline": 11122206.967955248,
+ "current": 10947061.867849775,
+ "changePercent": -1.574733329545952,
+ "bytesPerOp": {
+ "baseline": 504.0005284066075,
+ "current": 504.00053623053265
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-bytes-1-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 11122206.967955248,
+ "scoreError": 310513.2070654718,
+ "scoreConfidence": [
+ 10811693.760889776,
+ 11432720.17502072
+ ],
+ "scorePercentiles": {
+ "0.0": 10982918.201227628,
+ "50.0": 11143405.516395817,
+ "90.0": 11188627.031359864,
+ "95.0": 11188627.031359864,
+ "99.0": 11188627.031359864,
+ "99.9": 11188627.031359864,
+ "99.99": 11188627.031359864,
+ "99.999": 11188627.031359864,
+ "99.9999": 11188627.031359864,
+ "100.0": 11188627.031359864
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 11133662.95382252,
+ 10982918.201227628,
+ 11162421.136970408,
+ 11143405.516395817,
+ 11188627.031359864
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.0005284066075,
+ "scoreError": 1.4211016666288207e-05,
+ "scoreConfidence": [
+ 504.0005141955908,
+ 504.00054261762415
+ ],
+ "scorePercentiles": {
+ "0.0": 504.0005248350464,
+ "50.0": 504.0005264798438,
+ "90.0": 504.00053391609504,
+ "95.0": 504.00053391609504,
+ "99.0": 504.00053391609504,
+ "99.9": 504.00053391609504,
+ "99.99": 504.00053391609504,
+ "99.999": 504.00053391609504,
+ "99.9999": 504.00053391609504,
+ "100.0": 504.00053391609504
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.0005303577872,
+ 504.00053391609504,
+ 504.0005248350464,
+ 504.0005264798438,
+ 504.0005264442647
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-bytes-1-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10947061.867849775,
+ "scoreError": 385914.23951845686,
+ "scoreConfidence": [
+ 10561147.628331318,
+ 11332976.10736823
+ ],
+ "scorePercentiles": {
+ "0.0": 10772999.66000177,
+ "50.0": 10985207.305396587,
+ "90.0": 11013907.660538761,
+ "95.0": 11013907.660538761,
+ "99.0": 11013907.660538761,
+ "99.9": 11013907.660538761,
+ "99.99": 11013907.660538761,
+ "99.999": 11013907.660538761,
+ "99.9999": 11013907.660538761,
+ "100.0": 11013907.660538761
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 10772999.66000177,
+ 11013907.660538761,
+ 11009617.619334986,
+ 10985207.305396587,
+ 10953577.093976766
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.00053623053265,
+ "scoreError": 1.654433072945139e-05,
+ "scoreConfidence": [
+ 504.0005196862019,
+ 504.00055277486337
+ ],
+ "scorePercentiles": {
+ "0.0": 504.0005334528287,
+ "50.0": 504.00053484383113,
+ "90.0": 504.0005438041241,
+ "95.0": 504.0005438041241,
+ "99.0": 504.0005438041241,
+ "99.9": 504.0005438041241,
+ "99.99": 504.0005438041241,
+ "99.999": 504.0005438041241,
+ "99.9999": 504.0005438041241,
+ "100.0": 504.0005438041241
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.0005438041241,
+ 504.00053380800665,
+ 504.0005334528287,
+ 504.0005352438728,
+ 504.00053484383113
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 2,
+ "baseline": 10526431.725313628,
+ "current": 10978140.007805401,
+ "changePercent": 4.291181421008217,
+ "bytesPerOp": {
+ "baseline": 504.0005578958251,
+ "current": 504.00053462202686
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-bytes-2-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10526431.725313628,
+ "scoreError": 1785959.2034778409,
+ "scoreConfidence": [
+ 8740472.521835787,
+ 12312390.928791469
+ ],
+ "scorePercentiles": {
+ "0.0": 9699376.136752928,
+ "50.0": 10719806.764736637,
+ "90.0": 10773302.300078249,
+ "95.0": 10773302.300078249,
+ "99.0": 10773302.300078249,
+ "99.9": 10773302.300078249,
+ "99.99": 10773302.300078249,
+ "99.999": 10773302.300078249,
+ "99.9999": 10773302.300078249,
+ "100.0": 10773302.300078249
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 9699376.136752928,
+ 10773302.300078249,
+ 10679214.761730589,
+ 10760458.663269732,
+ 10719806.764736637
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.0005578958251,
+ "scoreError": 0.00010294964423369412,
+ "scoreConfidence": [
+ 504.00045494618087,
+ 504.0006608454694
+ ],
+ "scorePercentiles": {
+ "0.0": 504.0005443280701,
+ "50.0": 504.0005465062121,
+ "90.0": 504.0006056204416,
+ "95.0": 504.0006056204416,
+ "99.0": 504.0006056204416,
+ "99.9": 504.0006056204416,
+ "99.99": 504.0006056204416,
+ "99.999": 504.0006056204416,
+ "99.9999": 504.0006056204416,
+ "100.0": 504.0006056204416
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.0006056204416,
+ 504.0005443280701,
+ 504.00054858217874,
+ 504.0005444422232,
+ 504.0005465062121
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-bytes-2-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10978140.007805401,
+ "scoreError": 169883.76766565585,
+ "scoreConfidence": [
+ 10808256.240139745,
+ 11148023.775471058
+ ],
+ "scorePercentiles": {
+ "0.0": 10924595.068472372,
+ "50.0": 10978964.405319922,
+ "90.0": 11043951.915756091,
+ "95.0": 11043951.915756091,
+ "99.0": 11043951.915756091,
+ "99.9": 11043951.915756091,
+ "99.99": 11043951.915756091,
+ "99.999": 11043951.915756091,
+ "99.9999": 11043951.915756091,
+ "100.0": 11043951.915756091
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 10978964.405319922,
+ 10955766.352262024,
+ 10987422.2972166,
+ 10924595.068472372,
+ 11043951.915756091
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.00053462202686,
+ "scoreError": 9.97951276782495e-06,
+ "scoreConfidence": [
+ 504.0005246425141,
+ 504.0005446015396
+ ],
+ "scorePercentiles": {
+ "0.0": 504.00053166523367,
+ "50.0": 504.0005336622801,
+ "90.0": 504.00053784700975,
+ "95.0": 504.00053784700975,
+ "99.0": 504.00053784700975,
+ "99.9": 504.00053784700975,
+ "99.99": 504.00053784700975,
+ "99.999": 504.00053784700975,
+ "99.9999": 504.00053784700975,
+ "100.0": 504.00053784700975
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.0005336622801,
+ 504.00053677932044,
+ 504.00053315629066,
+ 504.00053784700975,
+ 504.00053166523367
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 3,
+ "baseline": 10989663.87159383,
+ "current": 10782752.22006754,
+ "changePercent": -1.8827841683230706,
+ "bytesPerOp": {
+ "baseline": 504.0005346652891,
+ "current": 504.0005442895799
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-bytes-3-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10989663.87159383,
+ "scoreError": 361133.35600759595,
+ "scoreConfidence": [
+ 10628530.515586233,
+ 11350797.227601426
+ ],
+ "scorePercentiles": {
+ "0.0": 10861354.623179004,
+ "50.0": 11015921.648730455,
+ "90.0": 11075460.520514706,
+ "95.0": 11075460.520514706,
+ "99.0": 11075460.520514706,
+ "99.9": 11075460.520514706,
+ "99.99": 11075460.520514706,
+ "99.999": 11075460.520514706,
+ "99.9999": 11075460.520514706,
+ "100.0": 11075460.520514706
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 11075460.520514706,
+ 11070374.805584187,
+ 11015921.648730455,
+ 10861354.623179004,
+ 10925207.759960793
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.0005346652891,
+ "scoreError": 1.591790470750439e-05,
+ "scoreConfidence": [
+ 504.0005187473844,
+ 504.0005505831938
+ ],
+ "scorePercentiles": {
+ "0.0": 504.0005291883601,
+ "50.0": 504.0005336313742,
+ "90.0": 504.00054040043966,
+ "95.0": 504.00054040043966,
+ "99.0": 504.00054040043966,
+ "99.9": 504.00054040043966,
+ "99.99": 504.00054040043966,
+ "99.999": 504.00054040043966,
+ "99.9999": 504.00054040043966,
+ "100.0": 504.00054040043966
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.00053362211423,
+ 504.0005291883601,
+ 504.0005336313742,
+ 504.00054040043966,
+ 504.0005364841573
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-bytes-3-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10782752.22006754,
+ "scoreError": 215185.63932878312,
+ "scoreConfidence": [
+ 10567566.580738757,
+ 10997937.859396324
+ ],
+ "scorePercentiles": {
+ "0.0": 10684293.317894747,
+ "50.0": 10806290.336876675,
+ "90.0": 10817980.418496404,
+ "95.0": 10817980.418496404,
+ "99.0": 10817980.418496404,
+ "99.9": 10817980.418496404,
+ "99.99": 10817980.418496404,
+ "99.999": 10817980.418496404,
+ "99.9999": 10817980.418496404,
+ "100.0": 10817980.418496404
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 10684293.317894747,
+ 10792238.111637497,
+ 10806290.336876675,
+ 10812958.915432382,
+ 10817980.418496404
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.0005442895799,
+ "scoreError": 1.5808271593356252e-05,
+ "scoreConfidence": [
+ 504.0005284813083,
+ 504.0005600978515
+ ],
+ "scorePercentiles": {
+ "0.0": 504.00054153434115,
+ "50.0": 504.00054283846436,
+ "90.0": 504.00055152177623,
+ "95.0": 504.00055152177623,
+ "99.0": 504.00055152177623,
+ "99.9": 504.00055152177623,
+ "99.99": 504.00055152177623,
+ "99.999": 504.00055152177623,
+ "99.9999": 504.00055152177623,
+ "100.0": 504.00055152177623
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.00055152177623,
+ 504.00054283846436,
+ 504.0005421300315,
+ 504.0005434232861,
+ 504.00054153434115
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 4,
+ "baseline": 10702182.80204327,
+ "current": 10999288.597920034,
+ "changePercent": 2.7761233513974304,
+ "bytesPerOp": {
+ "baseline": 504.0005483874205,
+ "current": 504.0005349273212
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-bytes-4-baseline",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10702182.80204327,
+ "scoreError": 728187.7709887801,
+ "scoreConfidence": [
+ 9973995.03105449,
+ 11430370.573032051
+ ],
+ "scorePercentiles": {
+ "0.0": 10364267.220925957,
+ "50.0": 10783631.401068112,
+ "90.0": 10796100.99226566,
+ "95.0": 10796100.99226566,
+ "99.0": 10796100.99226566,
+ "99.9": 10796100.99226566,
+ "99.99": 10796100.99226566,
+ "99.999": 10796100.99226566,
+ "99.9999": 10796100.99226566,
+ "100.0": 10796100.99226566
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 10796100.99226566,
+ 10793329.51410619,
+ 10783631.401068112,
+ 10773584.88185044,
+ 10364267.220925957
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.0005483874205,
+ "scoreError": 4.1099857372541304e-05,
+ "scoreConfidence": [
+ 504.00050728756315,
+ 504.00058948727786
+ ],
+ "scorePercentiles": {
+ "0.0": 504.00054269631954,
+ "50.0": 504.0005439042403,
+ "90.0": 504.00056744899393,
+ "95.0": 504.00056744899393,
+ "99.0": 504.00056744899393,
+ "99.9": 504.00056744899393,
+ "99.99": 504.00056744899393,
+ "99.999": 504.00056744899393,
+ "99.9999": 504.00056744899393,
+ "100.0": 504.00056744899393
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.00054269631954,
+ 504.00054351277623,
+ 504.00054437477246,
+ 504.0005439042403,
+ 504.00056744899393
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-bytes-4-current",
+ "benchmark": "org.apache.fory.benchmark.JsonSerializationSuite.foryToJsonBytes",
+ "primaryMetric": {
+ "score": 10999288.597920034,
+ "scoreError": 168622.5963103002,
+ "scoreConfidence": [
+ 10830666.001609733,
+ 11167911.194230335
+ ],
+ "scorePercentiles": {
+ "0.0": 10954966.721378582,
+ "50.0": 10996337.024679625,
+ "90.0": 11068311.861464404,
+ "95.0": 11068311.861464404,
+ "99.0": 11068311.861464404,
+ "99.9": 11068311.861464404,
+ "99.99": 11068311.861464404,
+ "99.999": 11068311.861464404,
+ "99.9999": 11068311.861464404,
+ "100.0": 11068311.861464404
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 10996337.024679625,
+ 10954966.721378582,
+ 11068311.861464404,
+ 11007077.043912297,
+ 10969750.33816526
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 504.0005349273212,
+ "scoreError": 9.169119006637945e-06,
+ "scoreConfidence": [
+ 504.00052575820223,
+ 504.0005440964402
+ ],
+ "scorePercentiles": {
+ "0.0": 504.0005321731479,
+ "50.0": 504.00053459000725,
+ "90.0": 504.00053874461037,
+ "95.0": 504.00053874461037,
+ "99.0": 504.00053874461037,
+ "99.9": 504.00053874461037,
+ "99.99": 504.00053874461037,
+ "99.999": 504.00053874461037,
+ "99.9999": 504.00053874461037,
+ "100.0": 504.00053874461037
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 504.00053459000725,
+ 504.00053874461037,
+ 504.0005321731479,
+ 504.0005348345519,
+ 504.00053429428874
+ ]
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "medianBaseline": 10845923.33681855,
+ "medianCurrent": 10962600.937827587,
+ "medianChangePercent": 0.6006950109257392,
+ "geometricMeanChangePercent": 0.8667224089766439,
+ "lower95ChangePercent": -2.7138790614917903
+ },
+ {
+ "case": "GoogleMapsAPIPrettyPrinting UTF-8",
+ "pairs": [
+ {
+ "pair": 1,
+ "baseline": 174597.81292143487,
+ "current": 205543.64294864787,
+ "changePercent": 17.724065101054798,
+ "bytesPerOp": {
+ "baseline": 25408.033722050004,
+ "current": 26200.028663394973
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-pretty-1-baseline",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.jsoniterScala",
+ "primaryMetric": {
+ "score": 174597.81292143487,
+ "scoreError": 3674.771783638936,
+ "scoreConfidence": [
+ 170923.04113779592,
+ 178272.58470507382
+ ],
+ "scorePercentiles": {
+ "0.0": 173099.40298585425,
+ "50.0": 174860.04332010643,
+ "90.0": 175485.05964719734,
+ "95.0": 175485.05964719734,
+ "99.0": 175485.05964719734,
+ "99.9": 175485.05964719734,
+ "99.99": 175485.05964719734,
+ "99.999": 175485.05964719734,
+ "99.9999": 175485.05964719734,
+ "100.0": 175485.05964719734
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 175485.05964719734,
+ 174860.04332010643,
+ 175262.62401628782,
+ 174281.93463772858,
+ 173099.40298585425
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 25408.033722050004,
+ "scoreError": 0.0009813706530393139,
+ "scoreConfidence": [
+ 25408.03274067935,
+ 25408.034703420657
+ ],
+ "scorePercentiles": {
+ "0.0": 25408.0333658103,
+ "50.0": 25408.033724123,
+ "90.0": 25408.03402768198,
+ "95.0": 25408.03402768198,
+ "99.0": 25408.03402768198,
+ "99.9": 25408.03402768198,
+ "99.99": 25408.03402768198,
+ "99.999": 25408.03402768198,
+ "99.9999": 25408.03402768198,
+ "100.0": 25408.03402768198
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 25408.033607911482,
+ 25408.0333658103,
+ 25408.033724123,
+ 25408.033884723256,
+ 25408.03402768198
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-pretty-1-current",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.fory",
+ "primaryMetric": {
+ "score": 205543.64294864787,
+ "scoreError": 2035.7920858449818,
+ "scoreConfidence": [
+ 203507.85086280288,
+ 207579.43503449287
+ ],
+ "scorePercentiles": {
+ "0.0": 204655.66707941596,
+ "50.0": 205686.9493881752,
+ "90.0": 206076.14206301537,
+ "95.0": 206076.14206301537,
+ "99.0": 206076.14206301537,
+ "99.9": 206076.14206301537,
+ "99.99": 206076.14206301537,
+ "99.999": 206076.14206301537,
+ "99.9999": 206076.14206301537,
+ "100.0": 206076.14206301537
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 204655.66707941596,
+ 205611.34955705435,
+ 205686.9493881752,
+ 206076.14206301537,
+ 205688.10665557842
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 26200.028663394973,
+ "scoreError": 0.0007862574785616849,
+ "scoreConfidence": [
+ 26200.027877137494,
+ 26200.02944965245
+ ],
+ "scorePercentiles": {
+ "0.0": 26200.028442108618,
+ "50.0": 26200.028683613124,
+ "90.0": 26200.02894666828,
+ "95.0": 26200.02894666828,
+ "99.0": 26200.02894666828,
+ "99.9": 26200.02894666828,
+ "99.99": 26200.02894666828,
+ "99.999": 26200.02894666828,
+ "99.9999": 26200.02894666828,
+ "100.0": 26200.02894666828
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 26200.028683613124,
+ 26200.02849234462,
+ 26200.02894666828,
+ 26200.028442108618,
+ 26200.0287522402
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 2,
+ "baseline": 164985.2309051822,
+ "current": 202799.9735029379,
+ "changePercent": 22.92007738528308,
+ "bytesPerOp": {
+ "baseline": 25408.035612909687,
+ "current": 26120.028977361933
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-pretty-2-baseline",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.jsoniterScala",
+ "primaryMetric": {
+ "score": 164985.2309051822,
+ "scoreError": 4660.460397774469,
+ "scoreConfidence": [
+ 160324.77050740772,
+ 169645.69130295666
+ ],
+ "scorePercentiles": {
+ "0.0": 163584.82394618526,
+ "50.0": 164677.05662426073,
+ "90.0": 166542.06285238217,
+ "95.0": 166542.06285238217,
+ "99.0": 166542.06285238217,
+ "99.9": 166542.06285238217,
+ "99.99": 166542.06285238217,
+ "99.999": 166542.06285238217,
+ "99.9999": 166542.06285238217,
+ "100.0": 166542.06285238217
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 164234.05682526025,
+ 163584.82394618526,
+ 164677.05662426073,
+ 165888.15427782256,
+ 166542.06285238217
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 25408.035612909687,
+ "scoreError": 0.0010434505732795133,
+ "scoreConfidence": [
+ 25408.034569459112,
+ 25408.036656360262
+ ],
+ "scorePercentiles": {
+ "0.0": 25408.03519741758,
+ "50.0": 25408.035671012454,
+ "90.0": 25408.035886683894,
+ "95.0": 25408.035886683894,
+ "99.0": 25408.035886683894,
+ "99.9": 25408.035886683894,
+ "99.99": 25408.035886683894,
+ "99.999": 25408.035886683894,
+ "99.9999": 25408.035886683894,
+ "100.0": 25408.035886683894
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 25408.035671012454,
+ 25408.035886683894,
+ 25408.035794832726,
+ 25408.03551460178,
+ 25408.03519741758
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-pretty-2-current",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.fory",
+ "primaryMetric": {
+ "score": 202799.9735029379,
+ "scoreError": 4353.887460104229,
+ "scoreConfidence": [
+ 198446.0860428337,
+ 207153.86096304213
+ ],
+ "scorePercentiles": {
+ "0.0": 201203.39887319936,
+ "50.0": 202837.49882023153,
+ "90.0": 204068.08551412937,
+ "95.0": 204068.08551412937,
+ "99.0": 204068.08551412937,
+ "99.9": 204068.08551412937,
+ "99.99": 204068.08551412937,
+ "99.999": 204068.08551412937,
+ "99.9999": 204068.08551412937,
+ "100.0": 204068.08551412937
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 201203.39887319936,
+ 202837.49882023153,
+ 202269.8101404362,
+ 203621.07416669314,
+ 204068.08551412937
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 26120.028977361933,
+ "scoreError": 0.0007090324545536642,
+ "scoreConfidence": [
+ 26120.02826832948,
+ 26120.029686394388
+ ],
+ "scorePercentiles": {
+ "0.0": 26120.028708227288,
+ "50.0": 26120.028992604926,
+ "90.0": 26120.02916714139,
+ "95.0": 26120.02916714139,
+ "99.0": 26120.02916714139,
+ "99.9": 26120.02916714139,
+ "99.99": 26120.02916714139,
+ "99.999": 26120.02916714139,
+ "99.9999": 26120.02916714139,
+ "100.0": 26120.02916714139
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 26120.02916714139,
+ 26120.02889787585,
+ 26120.029120960204,
+ 26120.028992604926,
+ 26120.028708227288
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 3,
+ "baseline": 165230.6073705634,
+ "current": 205899.9655676436,
+ "changePercent": 24.61369527370365,
+ "bytesPerOp": {
+ "baseline": 25408.03564430193,
+ "current": 26200.028587543013
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-pretty-3-baseline",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.jsoniterScala",
+ "primaryMetric": {
+ "score": 165230.6073705634,
+ "scoreError": 2082.6528168390482,
+ "scoreConfidence": [
+ 163147.95455372435,
+ 167313.26018740245
+ ],
+ "scorePercentiles": {
+ "0.0": 164605.0614016727,
+ "50.0": 165148.60445531708,
+ "90.0": 165980.0737867756,
+ "95.0": 165980.0737867756,
+ "99.0": 165980.0737867756,
+ "99.9": 165980.0737867756,
+ "99.99": 165980.0737867756,
+ "99.999": 165980.0737867756,
+ "99.9999": 165980.0737867756,
+ "100.0": 165980.0737867756
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 165148.60445531708,
+ 165980.0737867756,
+ 164885.9973916252,
+ 164605.0614016727,
+ 165533.2998174265
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 25408.03564430193,
+ "scoreError": 0.0004417309661412433,
+ "scoreConfidence": [
+ 25408.035202570965,
+ 25408.036086032895
+ ],
+ "scorePercentiles": {
+ "0.0": 25408.03551609323,
+ "50.0": 25408.035610521947,
+ "90.0": 25408.035818439235,
+ "95.0": 25408.035818439235,
+ "99.0": 25408.035818439235,
+ "99.9": 25408.035818439235,
+ "99.99": 25408.035818439235,
+ "99.999": 25408.035818439235,
+ "99.9999": 25408.035818439235,
+ "100.0": 25408.035818439235
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 25408.03568651327,
+ 25408.035610521947,
+ 25408.035818439235,
+ 25408.035589941974,
+ 25408.03551609323
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-pretty-3-current",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.fory",
+ "primaryMetric": {
+ "score": 205899.9655676436,
+ "scoreError": 7231.779174096243,
+ "scoreConfidence": [
+ 198668.18639354737,
+ 213131.74474173985
+ ],
+ "scorePercentiles": {
+ "0.0": 202967.4539848817,
+ "50.0": 205810.99566965742,
+ "90.0": 207702.17134753993,
+ "95.0": 207702.17134753993,
+ "99.0": 207702.17134753993,
+ "99.9": 207702.17134753993,
+ "99.99": 207702.17134753993,
+ "99.999": 207702.17134753993,
+ "99.9999": 207702.17134753993,
+ "100.0": 207702.17134753993
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 202967.4539848817,
+ 207702.17134753993,
+ 207378.44945612934,
+ 205810.99566965742,
+ 205640.75738000963
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 26200.028587543013,
+ "scoreError": 0.0009425194070230298,
+ "scoreConfidence": [
+ 26200.027645023605,
+ 26200.02953006242
+ ],
+ "scorePercentiles": {
+ "0.0": 26200.02828634156,
+ "50.0": 26200.028600712103,
+ "90.0": 26200.028863877014,
+ "95.0": 26200.028863877014,
+ "99.0": 26200.028863877014,
+ "99.9": 26200.028863877014,
+ "99.99": 26200.028863877014,
+ "99.999": 26200.028863877014,
+ "99.9999": 26200.028863877014,
+ "100.0": 26200.028863877014
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 26200.028863877014,
+ 26200.02840322991,
+ 26200.02828634156,
+ 26200.028600712103,
+ 26200.028783554477
+ ]
+ ]
+ }
+ }
+ }
+ },
+ {
+ "pair": 4,
+ "baseline": 175334.68707402513,
+ "current": 211121.99886334353,
+ "changePercent": 20.41085673721208,
+ "bytesPerOp": {
+ "baseline": 25408.033453005406,
+ "current": 26120.027906346735
+ },
+ "measurements": {
+ "baseline": {
+ "run": "final-pretty-4-baseline",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.jsoniterScala",
+ "primaryMetric": {
+ "score": 175334.68707402513,
+ "scoreError": 5296.881698351415,
+ "scoreConfidence": [
+ 170037.80537567372,
+ 180631.56877237654
+ ],
+ "scorePercentiles": {
+ "0.0": 173014.0137898809,
+ "50.0": 175662.20174572137,
+ "90.0": 176697.78384199797,
+ "95.0": 176697.78384199797,
+ "99.0": 176697.78384199797,
+ "99.9": 176697.78384199797,
+ "99.99": 176697.78384199797,
+ "99.999": 176697.78384199797,
+ "99.9999": 176697.78384199797,
+ "100.0": 176697.78384199797
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 175550.70748284203,
+ 176697.78384199797,
+ 173014.0137898809,
+ 175662.20174572137,
+ 175748.72850968337
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 25408.033453005406,
+ "scoreError": 0.0011952584224599013,
+ "scoreConfidence": [
+ 25408.032257746985,
+ 25408.034648263827
+ ],
+ "scorePercentiles": {
+ "0.0": 25408.0330382682,
+ "50.0": 25408.033393829402,
+ "90.0": 25408.033858928797,
+ "95.0": 25408.033858928797,
+ "99.0": 25408.033858928797,
+ "99.9": 25408.033858928797,
+ "99.99": 25408.033858928797,
+ "99.999": 25408.033858928797,
+ "99.9999": 25408.033858928797,
+ "100.0": 25408.033858928797
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 25408.033393829402,
+ 25408.0330382682,
+ 25408.033858928797,
+ 25408.033633306062,
+ 25408.03334069456
+ ]
+ ]
+ }
+ },
+ "current": {
+ "run": "final-pretty-4-current",
+ "benchmark": "com.github.plokhotnyuk.jsoniter_scala.benchmark.GoogleMapsAPIPrettyPrinting.fory",
+ "primaryMetric": {
+ "score": 211121.99886334353,
+ "scoreError": 4905.421559449824,
+ "scoreConfidence": [
+ 206216.5773038937,
+ 216027.42042279337
+ ],
+ "scorePercentiles": {
+ "0.0": 208930.38062617683,
+ "50.0": 211423.47887905603,
+ "90.0": 212235.43870714086,
+ "95.0": 212235.43870714086,
+ "99.0": 212235.43870714086,
+ "99.9": 212235.43870714086,
+ "99.99": 212235.43870714086,
+ "99.999": 212235.43870714086,
+ "99.9999": 212235.43870714086,
+ "100.0": 212235.43870714086
+ },
+ "scoreUnit": "ops/s",
+ "rawData": [
+ [
+ 211677.76066911514,
+ 212235.43870714086,
+ 208930.38062617683,
+ 211342.93543522884,
+ 211423.47887905603
+ ]
+ ]
+ },
+ "allocation": {
+ "score": 26120.027906346735,
+ "scoreError": 0.0008772736345718646,
+ "scoreConfidence": [
+ 26120.027029073102,
+ 26120.028783620368
+ ],
+ "scorePercentiles": {
+ "0.0": 26120.02775225487,
+ "50.0": 26120.027837400834,
+ "90.0": 26120.028306262284,
+ "95.0": 26120.028306262284,
+ "99.0": 26120.028306262284,
+ "99.9": 26120.028306262284,
+ "99.99": 26120.028306262284,
+ "99.999": 26120.028306262284,
+ "99.9999": 26120.028306262284,
+ "100.0": 26120.028306262284
+ },
+ "scoreUnit": "B/op",
+ "rawData": [
+ [
+ 26120.02777581221,
+ 26120.02775225487,
+ 26120.028306262284,
+ 26120.027837400834,
+ 26120.027860003484
+ ]
+ ]
+ }
+ }
+ }
+ }
+ ],
+ "medianBaseline": 169914.21014599915,
+ "medianCurrent": 205721.80425814574,
+ "medianChangePercent": 21.66546706124758,
+ "geometricMeanChangePercent": 21.389151036888382,
+ "lower95ChangePercent": 17.893637040735502
+ }
+ ]
+}
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/pretty-printing.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/pretty-printing.md
new file mode 100644
index 00000000000..13392fed02b
--- /dev/null
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/pretty-printing.md
@@ -0,0 +1,82 @@
+# JVM JSON 格式化输出测量
+
+本次测量覆盖 jsoniter-scala `GoogleMapsAPIPrettyPrinting` 工作负载上的
+`ForyJson.toPrettyJsonBytes`,并检查 Java `JsonSerializationSuite` MediaContent 工作负载的紧凑输出。
+吞吐量越高越好。
+
+格式化输出对比超过了 10% 的提升目标。紧凑输出的吞吐量点估计位于 2% 回退阈值以内,
+但其不确定性**不足以**可靠地证明该阈值,尤其是 String 对照仍无法得出确定结论。
+
+## 结果
+
+| 工作负载 | 参考中位数,ops/s | Fory 中位数,ops/s | 配对几何变化 | 单侧 95% 下界 | 配对数 |
+| --------------------------------------------- | ----------------: | -----------------: | -----------: | ------------: | -----: |
+| Google Maps 格式化 UTF-8,对比 jsoniter-scala | 169,914 | 205,722 | +21.39% | +17.89% | 4 |
+| MediaContent 紧凑 UTF-8,对比 Fory 基线 | 10,845,923 | 10,962,601 | +0.87% | -2.71% | 4 |
+| MediaContent 紧凑 String,对比 Fory 基线 | 8,383,745 | 8,199,076 | -1.35% | -6.27% | 6 |
+
+变化汇总相邻参考/当前运行的比值,不是两个独立中位数相除。下界对比值的对数使用 Student t 分布计算。
+所有配对均保留,没有剔除。String 配对变化介于 -7.72% 和 +10.93%,
+不能把平均值视为稳定低于 2% 回退的保证。
+
+两个版本的紧凑输出分配量均约为 UTF-8 504 B/op、String 528 B/op。
+格式化输出中 Fory 分配 26,120–26,200 B/op,jsoniter-scala 分配 25,408 B/op。
+对比使用各库返回独立字节数组的 API,不使用预分配输出。
+
+[全部迭代样本、分配测量、配对汇总及制品哈希](pretty-printing-results.json)以 JSON 提供。
+
+## 工作负载与格式
+
+原有 Google Maps 模型和输入未修改。适配器调用 `Fory.foryJson.toPrettyJsonBytes(obj)`;
+参考实现调用普通 `jsoniterScala`,而非 `jsoniterScalaPrealloc`。
+Scala 2 和 Scala 3 正确性规格将 Fory 与已有 Jackson 期望输出比较,没有修改 fixture 或预期结果。
+
+两者均对对象和数组使用两个空格的多行缩进。Fory 遵循该工作负载的 Jackson 格式,包括冒号两侧的空格;
+jsoniter-scala 保留原有格式,仅在冒号后加空格。因此两者的输出字节序列和大小不同。
+Fory 在序列化时直接输出缩进,不会对已完成的紧凑文档重新格式化。
+
+紧凑输出对照使用未修改的 `benchmarks/java` MediaContent 模型和 Eishay 输入。
+参考与当前版本之间只替换 Fory JSON runtime jar,core 和基准测试 jar 保持固定。
+
+## 环境与版本
+
+- 日期:2026 年 9 月 21 日。
+- 机器:Apple M4 Pro,12 个 CPU 核心,48 GiB RAM;macOS 15.7.2 arm64。
+- JDK:OpenJDK 25.0.3;JMH 1.37。
+- Fory 源码:`2b8af43f17c98633538594ab6ff942591728c0a4`,版本 `1.8.0-SNAPSHOT`。
+- 紧凑输出参考版本:`509a096aa3ac68c0ca9ee248d085db7855523584`。
+- jsoniter-scala 基准测试检出版本:`84cb277f2c2a16b4018bc61fdeec3eed62252a1e`,
+ 包含 Fory 格式化输出适配器,版本 `2.40.2-SNAPSHOT`。
+- Scala:基准测试为 3.9.0;Fory JSON Scala 和 jsoniter-scala core/macros 为 3.3.8。
+- 每次运行:一个 fork、一个线程、三轮 1 秒预热、五轮 1 秒测量。
+- JVM 参数:`-Xms1g -Xmx1g -XX:+UseParallelGC`;启用 JMH GC profiler。
+- 同一机器上按相邻参考/当前配对串行运行。保留桌面后台活动,测量不确定性如上所示。
+
+## 复现
+
+从各自源码版本构建 Fory core 和 JSON jar,并分别保留。使用
+`mvn -f benchmarks/java/pom.xml -Pjmh -DskipTests package` 构建 Java 基准测试 jar。
+以 Scala 3.9.0 构建 jsoniter-scala 基准测试 assembly 前,先安装当前 Fory JSON Scala 模块。
+以下命令使用对应的固定 jar:
+
+```bash
+java -cp "$RUNTIME_JAR:$CORE_JAR:$MEDIA_BENCHMARK_JAR" org.openjdk.jmh.Main \
+ '.*JsonSerializationSuite.foryToJsonString$' \
+ -t 1 -f 1 -wi 3 -i 5 -w 1s -r 1s -bm thrpt -tu s \
+ -jvmArgs '-Xms1g -Xmx1g -XX:+UseParallelGC' -foe true -prof gc \
+ -rf json -rff "$RESULT_FILE"
+```
+
+紧凑 UTF-8 选择 `.*JsonSerializationSuite.foryToJsonBytes$`。
+每个配对都先运行基线 jar,紧接着运行当前 jar。
+
+```bash
+java -cp "$SCALA_JSON_JAR:$RUNTIME_JAR:$CORE_JAR:$SCALA_BENCHMARK_JAR" org.openjdk.jmh.Main \
+ '.*GoogleMapsAPIPrettyPrinting.fory$' \
+ -t 1 -f 1 -wi 3 -i 5 -w 1s -r 1s -bm thrpt -tu s \
+ -jvmArgs '-Xms1g -Xmx1g -XX:+UseParallelGC' -foe true -prof gc \
+ -rf json -rff "$RESULT_FILE"
+```
+
+使用同一 classpath 和 JVM 设置,在每次 Fory 运行前立即运行
+`.*GoogleMapsAPIPrettyPrinting.jsoniterScala$`。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/scala/README.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/scala/README.md
index 0b436a5e545..cb7fbce885d 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/scala/README.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/benchmarks/json/scala/README.md
@@ -2,6 +2,8 @@
本测试使用同一个不可变 Scala MediaContent 模型和 Eishay JSON 文档,对比 fory-json-scala、jsoniter-scala 和 Jackson Scala。String 组不包含 UTF-8 转换;UTF-8 组中各库均使用直接操作字节数组的 API。
+独立的 Google Maps 工作负载见 [JVM JSON 格式化输出测量](../pretty-printing.md)。
+
- 测试日期:`2026-08-14`
- 源码提交:`588ad6ab355c4c23fa0a2e4f269a8c733cba7b01`
- 平台:macOS-15.7.2-arm64-arm-64bit (arm64)
@@ -24,18 +26,18 @@
## 结果 {#results}
-| 表示形式 | 操作 | fory-json-scala 次/秒 | jsoniter-scala 次/秒 | Jackson Scala 次/秒 | 最快 |
-| ------------- | ----------- | ----------------------: | ---------------------: | --------------------: | --------------- |
-| 字符串 | 序列化 | 6,760,588 | 2,748,997 | 1,955,855 | fory-json-scala |
-| 字符串 | 反序列化 | 3,771,280 | 2,350,297 | 960,362 | fory-json-scala |
-| UTF-8 字节 | 序列化 | 9,485,122 | 2,745,567 | 1,761,719 | fory-json-scala |
-| UTF-8 字节 | 反序列化 | 3,318,893 | 2,391,923 | 1,080,453 | fory-json-scala |
+| 表示形式 | 操作 | fory-json-scala 次/秒 | jsoniter-scala 次/秒 | Jackson Scala 次/秒 | 最快 |
+| ---------- | -------- | --------------------: | -------------------: | ------------------: | --------------- |
+| 字符串 | 序列化 | 6,760,588 | 2,748,997 | 1,955,855 | fory-json-scala |
+| 字符串 | 反序列化 | 3,771,280 | 2,350,297 | 960,362 | fory-json-scala |
+| UTF-8 字节 | 序列化 | 9,485,122 | 2,745,567 | 1,761,719 | fory-json-scala |
+| UTF-8 字节 | 反序列化 | 3,318,893 | 2,391,923 | 1,080,453 | fory-json-scala |
## Fory 性能优势 {#fory-performance-advantage}
-| 表示形式 | 操作 | 相对 jsoniter-scala | 相对 Jackson Scala |
-| ------------- | ----------- | ----------------: | ---------------: |
-| 字符串 | 序列化 | 145.9% | 245.7% |
-| 字符串 | 反序列化 | 60.5% | 292.7% |
-| UTF-8 字节 | 序列化 | 245.5% | 438.4% |
-| UTF-8 字节 | 反序列化 | 38.8% | 207.2% |
+| 表示形式 | 操作 | 相对 jsoniter-scala | 相对 Jackson Scala |
+| ---------- | -------- | ------------------: | -----------------: |
+| 字符串 | 序列化 | 145.9% | 245.7% |
+| 字符串 | 反序列化 | 60.5% | 292.7% |
+| UTF-8 字节 | 序列化 | 245.5% | 438.4% |
+| UTF-8 字节 | 反序列化 | 38.8% | 207.2% |
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/build-integration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/build-integration.md
index 679635fdf68..aae54f53ab6 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/build-integration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/build-integration.md
@@ -211,7 +211,7 @@ cc_library(
```yaml
dependencies:
- fory: ^1.7.4
+ fory: ^1.7.5
dev_dependencies:
build_runner: ^2.4.0
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/cli.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/cli.md
index 46d1757ec97..e6c3e6d5d10 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/cli.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/compiler/cli.md
@@ -659,5 +659,5 @@ fory = "x.y.z"
```yaml
dependencies:
- fory: ^1.7.4
+ fory: ^1.7.5
```
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/csharp.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/csharp.md
index fe98f7d0dea..d4232243667 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/csharp.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/csharp.md
@@ -36,7 +36,7 @@ gRPC 客户端、服务基类、方法描述符、元数据、截止时间、取
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.4" />
+ <PackageReference Include="Apache.Fory" Version="1.7.5" />
<PackageReference Include="Grpc.AspNetCore" Version="2.71.0" />
</ItemGroup>
```
@@ -45,7 +45,7 @@ gRPC 客户端、服务基类、方法描述符、元数据、截止时间、取
```xml
<ItemGroup>
- <PackageReference Include="Apache.Fory" Version="1.7.4" />
+ <PackageReference Include="Apache.Fory" Version="1.7.5" />
<PackageReference Include="Grpc.Core.Api" Version="2.71.0" />
<PackageReference Include="Grpc.Net.Client" Version="2.71.0" />
</ItemGroup>
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/dart.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/dart.md
index e820d9ef72f..5357875e156 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/dart.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/dart.md
@@ -29,7 +29,7 @@ license: |
```yaml
dependencies:
- fory: ^1.7.4
+ fory: ^1.7.5
grpc: ^4.0.0
dev_dependencies:
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/rust.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/rust.md
index fef383ec3bb..fef66910370 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/rust.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/grpc/rust.md
@@ -29,7 +29,7 @@ license: |
```toml
[dependencies]
-fory = "1.7.4"
+fory = "1.7.5"
bytes = "1"
tonic = { version = "0.14", features = ["transport"] }
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/annotations.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/annotations.md
index 141e1d3f5e8..c2e36b3ba1f 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/annotations.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/annotations.md
@@ -19,7 +19,7 @@ license: |
limitations under the License.
---
-Fory JSON 在 `org.apache.fory.json.annotation` 中提供以下映射和验证注解:`JsonAnyGetter`、`JsonAnyProperty`、`JsonAnySetter`、`JsonByteArray`、`JsonCodec`、`JsonCreator`、`JsonFormat`、`JsonIgnore`、`JsonProperty`、`JsonPropertyOrder`、`JsonRawValue`、`JsonSubTypes`、`JsonUnwrapped`、`JsonValidator` 和 `JsonValue`。`JsonType` 是独立的构建期模型标记。这些属于 Fory JSON API,不是 Jackson、Gson 或 Fory 二进制协议兼容注解。
+Fory JSON 在 `org.apache.fory.json.annotation` 中提供以下映射和验证注解:`JsonAnyGetter`、`JsonAnyProperty`、`JsonAnySetter`、`JsonByteArray`、`JsonCodec`、`JsonCreator`、`JsonFormat`、`JsonIgnore`、`JsonInclude`、`JsonProperty`、`JsonPropertyOrder`、`JsonRawValue`、`JsonSubTypes`、`JsonUnwrapped`、`JsonValidator` 和 `JsonValue`。`JsonType` 是独立的构建期模型标记。这些属于 Fory JSON API,不是 Jackson、Gson 或 Fory 二进制协议兼容注解。
`JsonType` 不会被继承,因此每个需要参与平台构建流程且符合要求的具体模型都必须单独标注。Java 源码需要使用 `fory-annotation-processor`。未标注的普通 Java 类仍可使用反射;在 Android 上,它们需要由应用编写精确 R8 规则。经过 Android 脱糖处理的 Record 必须直接声明 `JsonType`,或使用已编译的精确 `JsonMixin` 配对。在 Native Image 之外,直接标注的 Java 模型如果使用默认对象编解码器却未运行注解处理器,会在创建编解码器时失败。
@@ -96,7 +96,7 @@ Mixin 提供的 `JsonCodec` 会成为目标的有效注解。精确的 `register
## `JsonProperty`
-`JsonProperty` 配置一个完整逻辑属性的规范名称、序列化索引和 null 包含策略。字段、getter 或 setter
+`JsonProperty` 配置一个完整逻辑属性的规范名称、序列化索引和值包含策略。字段、getter 或 setter
上的注解会应用于合并后的字段/getter/setter 属性组。
```java
@@ -124,12 +124,15 @@ public final class User {
支持以下包含策略:
-- `DEFAULT`:使用 `ForyJsonBuilder.defaultPropertyInclusion`(初始值为 `NON_NULL`)。
+- `DEFAULT`:继承类上的 `JsonInclude`,再使用 `ForyJsonBuilder.defaultPropertyInclusion`(初始值为 `NON_NULL`)。
- `ALWAYS`:即使选中的值为 null,也写入该属性。
- `NON_NULL`:省略 null 值。
- `NON_EMPTY`:省略 null、长度为零的 `CharSequence`(包括字符串)和 Java 数组、
空的 `java.util.Collection` 和 `java.util.Map`,以及不含值的 JDK `Optional`、
`OptionalInt`、`OptionalLong` 和 `OptionalDouble`。
+ 安装 Scala 模块后,还会省略 `None` 以及受支持的空严格求值 Scala 集合和 Map。
+- `NON_DEFAULT`:显式授权在属性等于受支持的默认值时省略它。不同的值(包括 null 或空值)仍会保留。
+ 不支持的默认值来源会在模型初始化时失败。见[默认值省略](#jsoninclude-and-default-omission)。
```java
public final class Response {
@@ -138,9 +141,11 @@ public final class Response {
}
```
-当 `items` 是空列表时,该对象会写为 `{}`。属性上显式指定的包含策略优先于 builder 默认值。
-空值检查针对属性的逻辑值,在调用选定的编解码器之前执行。自定义编解码器将普通对象写为 `""`
-或 `{}`,并不会使该对象被视为空。空 `byte[]` 无论使用 Base64 还是数字数组表示,都属于空值。
+当 `items` 是空列表时,该对象会写为 `{}`。属性上显式指定的包含策略优先于类和 builder 默认值。
+Java 空值检查直接执行,即使该值使用自定义编解码器也是如此。其他类型使用选定编解码器的
+`isEmpty(writer, value)`,其默认返回 `false`。自定义编解码器需要重写该方法才能定义空值;
+仅写出 `""` 或 `{}` 并不会使普通对象被视为空。空 `byte[]` 使用 Base64、Base16 或数字数组表示时
+都属于空值。见[自定义空值](custom-codecs.md#custom-empty-values)。
过滤只检查当前属性值,不递归检查内部内容:`0`、`false`、含 null 的列表、含空列表的列表,
以及包含空列表的非空 Optional 都会保留。属性包含策略不会过滤根值、集合元素、Map 条目或
@@ -148,7 +153,7 @@ Any 条目。原始 JSON String 属性按字符串检查,不会解析其中的
Kotlin 属性遵循配置的包含策略,即使省略属性会因默认值而改变读取结果,或导致缺少必需属性的读取失败;
请参阅 [Kotlin 包含策略](kotlin.md#immutable-classes-and-compiler-defaults)。
-Scala 仍遵循[必需构造函数参数规则](scala.md#case-classes-and-annotations)。
+Scala 的字段缺失行为见 [case class 与注解](scala.md#case-classes-and-annotations)。
包含策略只影响写入。对于没有写入来源、仅供创建器使用的属性,非默认包含策略无效。可以重复相同声明;
同一逻辑属性中相互冲突的显式名称、索引或非默认包含策略会被拒绝。规范化为同一最终 JSON 名称的两个
@@ -161,6 +166,83 @@ Scala 仍遵循[必需构造函数参数规则](scala.md#case-classes-and-annota
不支持别名以及相互独立的读写名称。`JsonProperty` 不能与 Any 逻辑属性组合,
也不能声明在 `JsonAnySetter` 上。
+## `JsonInclude` 与默认值省略 {#jsoninclude-and-default-omission}
+
+默认值可能依赖构造函数参数、时间、随机数或外部状态。能够求值并不意味着省略后能恢复相同的值。
+因此,`NON_DEFAULT` 需要逐属性显式授权,或通过类注解批量授权:
+
+```java
+import org.apache.fory.json.annotation.JsonInclude;
+import org.apache.fory.json.annotation.JsonProperty;
+import org.apache.fory.json.annotation.JsonProperty.Include;
+
+@JsonInclude(Include.NON_DEFAULT)
+public final class Options {
+ public int retries = 3;
+ public String label = "default";
+ @JsonProperty(include = Include.ALWAYS)
+ public long timestamp;
+}
+```
+
+未修改的 `Options` 写为 `{"timestamp":0}`。若只授权 `retries`,移除 `JsonInclude`,并在该字段上
+添加 `@JsonProperty(include = Include.NON_DEFAULT)`。属性策略优先于类策略,类策略优先于 builder 默认值。
+类注解不被子类继承;类上的 `DEFAULT` 使用 builder 设置。
+
+类级授权也覆盖**未来新增的属性**。维护者必须确认每个新属性的默认值稳定、求值安全,并能在字段缺失时
+恢复一致的值,或通过 `ALWAYS` 排除该属性。`defaultPropertyInclusion(NON_DEFAULT)` 会立即抛出配置错误,
+避免全局授权将此契约静默应用于无关模型。`NON_EMPTY` 不授予默认值求值权限。
+
+| 模型 | 支持的默认值来源 |
+| ----------------------------------------------------------------------------------- | ------------------------------------------------------ |
+| Scala 构造函数属性 | 每次写入时,用实际的前置参数调用声明的编译器默认值方法 |
+| Java 普通无参模型 | 使用读取时选定的无参构造函数创建一个参考对象 |
+| 选定构造函数的所有参数都有默认值的 Kotlin 模型 | 使用这些语言默认值创建一个参考对象 |
+| Kotlin 普通无参模型 | 使用该构造函数创建一个参考对象 |
+| Java 必需构造函数参数、含必需参数的 Kotlin 构造函数,或缺少默认值/依赖的 Scala 属性 | 对已授权属性报错 |
+
+每份已初始化的模型元数据只构造一次参考对象,而非每次序列化都构造。声明类型与动态类型的模型使用位置
+可能分别初始化。授权允许执行**整个构造函数**、其他字段初始化器及 Kotlin `init` 块。
+没有 `NON_DEFAULT` 的模型不会创建参考对象。其他无参构造函数不能替换已选定的创建器。
+构造失败或访问已授权属性失败时会报告模型与属性,不会静默回退或绕过构造函数分配对象。
+
+调用方负责保证默认值稳定、比较求值没有外部可见副作用,以及字段缺失时能恢复相同的逻辑值。
+Fory 不证明纯度或分析默认值表达式。Scala 依赖式默认值方法在接收实际参数且读取能恢复同一上下文时可以安全使用。
+固定的 Java/Kotlin 参考对象无法表示随当前输入变化的默认值:对于 `low=1, high=low+1`,
+若在 `low=5` 的对象中省略 `high=2`,读取会得到 `high=6`。此时应通过 `ALWAYS` 保留 `high`。
+
+基本类型按值比较。浮点数区分正零和负零,非有限值保留并按常规方式输出。数组比较精确的数组类型与内容,
+嵌套数组递归比较;其他引用使用 `equals`。不支持循环结构的深度比较。
+读取行为独立:显式 null 不等于缺失,可变参考默认值不会与解码对象共享。
+
+可以通过已有 Mixin 机制授权默认值,而不修改模型:
+
+```java
+import org.apache.fory.json.ForyJson;
+import org.apache.fory.json.annotation.JsonMixin;
+import org.apache.fory.json.annotation.JsonProperty;
+import org.apache.fory.json.annotation.JsonProperty.Include;
+
+final class RetryPolicy {
+ public int retries = 3;
+ public long timestamp;
+}
+
+@JsonMixin(target = RetryPolicy.class)
+abstract class RetryPolicyMixin {
+ @JsonProperty(include = Include.NON_DEFAULT)
+ int retries;
+}
+
+// A class-level @JsonInclude on a Mixin can also supply the target's class policy.
+var json = ForyJson.builder().registerMixin(RetryPolicyMixin.class).build();
+json.toJson(new RetryPolicy()); // {"timestamp":0}
+```
+
+Android 和 Native Image 继续使用已有的 `@JsonType` 或 Mixin 构建配置。
+使用 R8/ProGuard 的 Kotlin 应用必须运行 JSON KSP。默认值在运行时求值,不在注解处理阶段求值。
+见 [Kotlin](kotlin.md)。
+
## `JsonPropertyOrder`
`JsonPropertyOrder` 将具名序列化前缀、属性索引和按最终名称的字母顺序排序结合起来:
@@ -328,8 +410,8 @@ Map 值。它不能放在 setter、创建器参数或 Any 声明上,也不能
## `JsonByteArray`
-未标注的 `byte[]` 值使用带引号的标准 Base64 JSON 字符串。`JsonByteArray` 为一个精确的 `byte[]`
-字段或 getter 选择 `BASE64` 或 `ARRAY` 表示,并同时作用于读写:
+`JsonByteArray` 为一个精确的 `byte[]` 字段或 getter 选择 `BASE64`、`BASE16` 或 `ARRAY` 表示,
+并同时作用于读写。它覆盖 builder 的 `byteArrayFormat`,后者默认为 `BASE64`:
```java
import org.apache.fory.json.annotation.JsonByteArray;
@@ -340,23 +422,51 @@ public final class Attachment {
@JsonByteArray(JsonByteArray.Format.BASE64)
public byte[] content;
+
+ @JsonByteArray(JsonByteArray.Format.BASE16)
+ public byte[] hex;
}
```
-对于字节 `{1, -2, 3}`,`numbers` 写为 `[1,-2,3]`,`content` 写为 `"Af4D"`。`ARRAY` 按有符号
+对于字节 `{1, -2, 3}`,`numbers` 写为 `[1,-2,3]`,`content` 写为 `"Af4D"`,`hex` 写为 `"01fe03"`。
+`BASE16` 写入不带前缀或分隔符的小写十六进制字符,读取接受大小写字符及 JSON 字符串转义,
+拒绝奇数长度或无效的十六进制字符串。`ARRAY` 按有符号
字节范围 `[-128, 127]` 读取 JSON 数组;`BASE64` 读取标准 Base64 字符串,并在写入时保留填充符。
-两种表示都接受 JSON null,null 输出遵循属性的常规包含规则。默认 Base64 编解码器不接受数字数组
+三种表示都接受 JSON null,null 输出遵循属性的常规包含规则。默认 Base64 编解码器不接受数字数组
输入;使用该格式的属性应选择 `ARRAY`。
使用该注解时必须指定格式。它只作用于被标注的字节数组属性,不作用于容器元素或 Map 值。Mixin
声明可以选择或移除该注解。它不能与 `JsonRawValue`、声明位置上的 `JsonCodec`、`JsonFormat` 或 Any
声明共用于同一逻辑属性。同一属性的字段和 getter 选择冲突格式时会被拒绝。
-Base64 值是二进制叶值,不计入对象图内存配额;数字数组则会将其数组存储计入该配额。详见
+Base64 和 Base16 值是二进制叶值,不计入对象图内存配额;数字数组则会将其数组存储计入该配额。详见
[安全](security.md#depth-and-graph-memory-limits)。
## `JsonFormat`
+在 Boolean 或数值属性上使用 `@JsonFormat(shape = JsonFormat.Shape.STRING)`,可将其 JSON token
+文本写入引号内,例如将 `false` 写为 `"false"`、`7` 写为 `"7"`。它也适用于匹配的创建器或 setter
+参数,包括 Scala 构造函数属性;还可通过 Mixin 配置而不修改模型:
+
+```java
+import org.apache.fory.json.annotation.JsonFormat;
+
+public class Metrics {
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ public boolean active;
+
+ @JsonFormat(shape = JsonFormat.Shape.STRING)
+ public long count;
+}
+```
+
+读取同时接受带引号和原生 token,遵循声明标量类型的常规范围与 null 规则。
+null 引用仍为 JSON `null`,并遵循属性包含策略。支持 Boolean、基本/装箱数值类型、
+`BigInteger`、`BigDecimal`,以及 Scala 模块的 `BigInt`/`BigDecimal`。
+非有限浮点值保留原有字符串表示(`"NaN"`、`"Infinity"` 或 `"-Infinity"`)。
+字符串形态不能与 pattern、timezone 或自定义值表示组合。
+下方的直接包装规则也适用于标量字符串形态;它不会递归地将任意对象转为字符串,也不改变 Map 键。
+
在日期/时间字段上使用 `JsonFormat`,可为读写两个方向选择 JSON 文本格式。格式采用
`DateTimeFormatter` 语法和根语言环境:
@@ -403,7 +513,7 @@ public final class Schedule {
如果必须在夏令时重叠期间保留精确时刻,请在格式中包含偏移量。省略 `timezone` 时保留上述默认行为。
无效的时区标识符,以及在其他受支持日期/时间类型上使用非空 `timezone`,都会被拒绝。
-`JsonFormat` 是字段注解,而不是类型使用注解。Record 组件通过其生成字段生效。嵌套包装、Map 键、
+`JsonFormat` 通过字段、创建器参数或 setter 参数配置逻辑属性,而不是类型使用注解。支持 Record 组件。嵌套包装、Map 键、
原始类型或通配符直接子元素、JSON Any 值以及展开值会被有意拒绝。不支持格式化语义模糊的类型,包括
旧版和 SQL 日期类型、`Duration`、`Period`、`TimeZone`、`ZoneId` 和 `ZoneOffset`。具有完整注册表示、
注解选择表示、多态表示或 `JsonValue` 表示的包装类型也会被拒绝,因为这些表示方式拥有整个包装对象。
@@ -448,8 +558,10 @@ Any 处理。
Fory 会拒绝重复的最终名称、仅由展开属性构成的递归链、参数化子对象、JSON Any 子对象、多态或自定义
编解码器子对象根,以及标量、数组、集合或 Map 子对象。若要展开 Map,请使用 `JsonAnyProperty`、
-`JsonAnyGetter` 或 `JsonAnySetter`。展开属性不能使用 `JsonProperty.value`、非默认的
-`JsonProperty.include`、`JsonCodec` 和 `JsonFormat`;普通子叶属性仍可使用这些配置。
+`JsonAnyGetter` 或 `JsonAnySetter`。展开组可以用 `NON_DEFAULT` 在匹配已授权默认值时省略整个组,
+或用 `ALWAYS` 排除类级默认值策略;各子属性仍按自身策略决定是否输出。
+展开属性不支持其他显式组包含策略、`JsonProperty.value`、`JsonCodec` 和 `JsonFormat`;
+普通子叶属性仍可使用这些配置。
## 动态对象成员
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/custom-codecs.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/custom-codecs.md
index 2084dc30b1c..620dc6445dd 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/custom-codecs.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/custom-codecs.md
@@ -24,6 +24,10 @@ Fory 的 String 或 UTF-8 写入器,并直接从 Fory 的 Latin-1、UTF-16 或
它不是 JSON 抽象语法树(AST)或 `JsonNode` 编解码器。它负责处理包含 JSON null 在内的完整值,
但绝不处理 Map 键;JSON 对象成员名称仍由 `MapKeyCodec` 负责。
+使用 `writeString`、`writeChar`、`writeFieldName` 或 writer 的转义追加方法,
+以遵循实例的 `escapeNonAscii` 设置。直接写入原始内容会保留传入内容;
+输出原始 token 的自定义编解码器应自行负责转义。见[非 ASCII 转义](object-mapping.md#non-ascii-escaping)。
+
如果应用编解码器在每种表示形式下都采用相同语义,请继承 `AbstractJsonValueCodec<T>`,
只需实现一次 JSON 结构:
@@ -102,8 +106,8 @@ ForyJson json =
仅当工厂在动态写入期间为值的实际类选择编解码器时,`runtimeType` 才为 `true`;声明的根类型和复合子类型收到的是 `false`。复合编解码器如果在构造后仍需此区分,必须保留该标志供后续 `resolveTypes` 调用使用,不能从 resolver 状态推断。
外层属性仍控制其名称、忽略方向和包含策略。如果属性被 `NON_NULL` 或 `NON_EMPTY` 省略,
-就不会调用值编解码器。`NON_EMPTY` 检查属性的逻辑值,因此即使使用自定义 List 编解码器,
-空 List 仍被视为空。普通应用对象不会因为其编解码器输出的 JSON 内容而被视为空。
+就不会调用编解码器的写入操作。`NON_EMPTY` 直接检查 Java 空值类型,
+其他类型使用编解码器的 `isEmpty` 方法;见[自定义空值](#custom-empty-values)。
如果属性会被输出,或者该值是数组元素、集合元素、Map 值、Optional 值或原子引用值,
编解码器就会接收并负责处理 null。注册的实例会在并发操作之间共享,因此必须是线程安全的。
@@ -116,6 +120,29 @@ Fory JSON 不会使用目标类型的 `JsonValidator` 方法来包装完整的
为 `JsonSubTypes` 基类注册自定义编解码器,会取代该基类的子类型注解。对于列出的子类型,
两种包装器包含方式支持注册自定义编解码器,但内联属性包含方式不支持。
+## 自定义空值 {#custom-empty-values}
+
+对于内置 Java 空值类型之外的非 null 值,`NON_EMPTY` 调用选定编解码器的
+`isEmpty(JsonWriter writer, T value)`。默认返回 `false`。如果类型有空状态,可重写它:
+
+```java
+// Inside MoneyCodec: treat a missing amount as an empty Money value.
+@Override
+public boolean isEmpty(JsonWriter writer, Money value) {
+ return value.amount == null;
+}
+```
+
+通过属性上的 `@JsonProperty(include = JsonProperty.Include.NON_EMPTY)`、
+类上的 `@JsonInclude(JsonProperty.Include.NON_EMPTY)` 或
+`defaultPropertyInclusion(JsonProperty.Include.NON_EMPTY)` 启用省略。
+该方法不能写入输出;writer 参数为动态编解码器提供当前操作的上下文。
+
+字符串和其他 Java `CharSequence`、数组、Java 集合/Map 及 JDK Optional 使用直接空值检查,
+不调用自定义 `isEmpty`。检查针对原始值,与编解码器的表示方式无关。
+对于其他类型(包括 Scala Option 和集合),替换内置编解码器也会替换其空值行为。
+根值、容器元素及非空包装器的内容不会被递归过滤。
+
## 使用 `JsonCodec` 选择编解码器
在类、record、枚举或接口上使用 `@JsonCodec`,可声明其默认的完整值编解码器。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/getting-started.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/getting-started.md
index 9134bea7d70..83f68cc667b 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/getting-started.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/getting-started.md
@@ -41,7 +41,7 @@ Maven:
<dependency>
<groupId>org.apache.fory</groupId>
<artifactId>fory-json</artifactId>
- <version>1.7.4</version>
+ <version>1.7.5</version>
</dependency>
```
@@ -55,7 +55,7 @@ repositories {
mavenCentral()
}
-implementation("org.apache.fory:fory-json:1.7.4")
+implementation("org.apache.fory:fory-json:1.7.5")
```
### Kotlin
@@ -64,7 +64,7 @@ Kotlin/JVM 应用添加可选的 Kotlin JSON 运行时,并使用其统一 buil
```kotlin title="build.gradle.kts"
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.4")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.5")
}
```
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/graalvm.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/graalvm.md
index e76f9b7ff3c..c58044ad616 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/graalvm.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/graalvm.md
@@ -150,7 +150,14 @@ public class JsonExample {
支持在类型、字段、有效的普通 getter、setter 值参数和 `JsonCreator` 参数上使用 `@JsonCodec` 注解。Feature 会保留每个选定的完整值、元素、内容、Map 键和 Map 值 Codec 的构造函数。这与 JVM 和 Android 使用的注解模型相同。
-支持 `JsonValue` 字段和有效的 public 无参数方法,包括匹配的单 String `JsonCreator` 构造函数和 public static factory。固定的 `JsonRawValue` 字段和 getter 支持可信的原始 String 值;`JsonByteArray` 字段和 getter 与 JVM 上一样选择 Base64 字符串或数字字节数组。`JsonFormat` 日期/时间字段使用与 JVM 相同的直接字段、单层包装和 `timezone` 行为。对于直接放在目标类上的注解,请使用 `JsonType` 标注每个可达的所属模型,以便 Native Image 保留这些成员和所选字节数组编解码器的构造函数。
+支持 `JsonValue` 字段和有效的 public 无参数方法,包括匹配的单 String `JsonCreator` 构造函数和 public static factory。
+固定的 `JsonRawValue` 字段和 getter 支持可信的原始 String 值;`JsonByteArray` 字段和 getter 与 JVM 上一样
+选择 Base64 字符串、Base16 字符串或数字字节数组。builder 的 `byteArrayFormat` 控制默认表示;
+使用生成的对象编解码器时,应在 provider 中包含该设置。`escapeNonAscii(true)` 对字符串值和名称的作用
+与 JVM 相同,使用生成的对象编解码器时也应在 provider 中配置。原始 JSON 保持原样。
+`JsonFormat` 日期/时间字段使用与 JVM 相同的直接字段、单层包装和 `timezone` 行为。
+对于直接放在目标类上的注解,请使用 `JsonType` 标注每个可达的所属模型,
+以便 Native Image 保留这些成员和所选字节数组编解码器的构造函数。
直接标注的 `JsonValue` Record 会使用生成的 component accessor 和 canonical constructor 操作。由 Mixin 提供的有效声明则使用上述 Mixin 工作流。
`JsonAnyProperty` 和 `JsonAnyGetter` 会将其 Map 展平到外层对象中。可以在该字段或 getter 上使用 `@JsonCodec(valueCodec = ...)` 来定制每个动态值。`JsonAnySetter` 的第二个参数可以对自身的值结构使用常规配置。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/kotlin.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/kotlin.md
index 282b0313c48..671eb4be2e6 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/kotlin.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/kotlin.md
@@ -38,7 +38,7 @@ repositories {
}
dependencies {
- implementation("org.apache.fory:fory-json-kotlin:1.7.4")
+ implementation("org.apache.fory:fory-json-kotlin:1.7.5")
}
```
@@ -50,7 +50,7 @@ plugins {
}
dependencies {
- ksp("org.apache.fory:fory-json-kotlin-ksp:1.7.4")
+ ksp("org.apache.fory:fory-json-kotlin-ksp:1.7.5")
}
```
@@ -77,11 +77,32 @@ val text = json.toJson(Account(7u, "Alice"), accountType)
val decoded = json.fromJson(text, accountType)
```
+使用 `ForyJsonKotlin.builder().escapeNonAscii(true)` 可以在紧凑和格式化输出中转义非 ASCII 字符串内容与名称。
+该设置在实例构建后固定;原始 JSON 保持原样。见[非 ASCII 转义](object-mapping.md#non-ascii-escaping)。
+
当有符号 `Long` 和无符号 `ULong` 值需要以带引号的十进制字符串输出时,请使用
`ForyJsonKotlin.builder().writeLongAsString(true)`。该设置还适用于声明的 collection 和 Map 值、
可空值、以这些类型为底层值的 Kotlin 值类、`ULongArray`,以及核心 JSON 运行时支持的 Java Long
类包装器。Reader 同时接受带引号和不带引号的整数 token。
+`ByteArray` 默认使用 Base64 字符串。标准 builder 的 `byteArrayFormat` 也控制根数组,
+以及嵌套在属性、集合和 Map 中的数组:
+
+```kotlin
+import org.apache.fory.json.annotation.JsonByteArray
+import org.apache.fory.json.kotlin.ForyJsonKotlin
+import org.apache.fory.json.kotlin.jsonTypeRef
+
+val hexJson = ForyJsonKotlin.builder().byteArrayFormat(JsonByteArray.Format.BASE16).build()
+val bytesType = jsonTypeRef<ByteArray>()
+val text = hexJson.toJson(byteArrayOf(1, -2, 3), bytesType) // "\"01fe03\""
+val bytes = hexJson.fromJson(text, bytesType)
+```
+
+`@field:JsonByteArray` 或 `@get:JsonByteArray`(包括 Mixin 声明)可以覆盖该属性的默认格式。
+`UByteArray` 保留无符号数字数组表示。可接受的输入和 null 行为见
+[字节数组格式](object-mapping.md#builder-configuration)。
+
`jsonTypeRef<T>()` 是类型令牌,不是编解码器查找操作。应创建一次并复用。Java `Class` 或普通 Java `TypeRef` 无法表达 `List<Account?>`、`UInt` 或降低为基本类型载体的逻辑值类等区别。
也可以通过 builder 显式安装模块:
@@ -117,7 +138,7 @@ data class Request(
- `{"id":1}` 会调用两个编译器默认值。
- `{"id":1,"label":null}` 会传入显式 null,不调用 `label` 的默认值。
-- 缺少 `id` 会在调用构造函数前失败。
+- 缺少 `id` 使用 `0`。
- `{"id":1,"retries":null}` 会失败;null 不会要求 Kotlin 使用默认值。
普通类体 `var` 属性在成员缺失时保留初始化值,在成员存在时于构造后赋值。`lateinit` 属性是必需的。自动 creator 属性和延后赋值属性都必须能在读写两个方向重建。
@@ -126,7 +147,7 @@ data class Request(
Kotlin 的构造函数参数和类体属性都遵循配置的[属性包含策略](annotations.md#jsonproperty)。
默认的 `NON_NULL` 省略 null,`NON_EMPTY` 还会省略空字符串、数组、集合、Map 和不含值的 JDK Optional。
-属性上的 `@JsonProperty(include = ...)` 优先于 builder 默认值。使用 `ALWAYS` 或
+属性上的 `@JsonProperty(include = ...)` 优先于类上的 `@JsonInclude` 策略,后者优先于 builder 默认值。使用 `ALWAYS` 或
`writeNullFields(true)` 可以保留 null。
```kotlin
@@ -144,10 +165,54 @@ val text = json.toJson(Response(1, items = emptyList())) // {"id":1}
```
包含策略只影响写入。读取示例输出时,`items` 使用声明的默认值 null,因此不会保留原来的空列表。
-缺失的构造函数参数使用声明的默认值;如果没有默认值则读取失败。缺失的类体属性保留初始化值。
+缺失的构造函数参数优先使用声明的默认值;否则,非空数值和 Boolean 参数使用零和 `false`,
+可空参数使用 `null`,其他非空参数仍为必需参数。缺失的类体属性保留初始化值。
显式 null 与字段缺失不同,非空属性仍会拒绝显式 null。如果需要精确往返,应选择能保留所需值的包含策略。
-序列化时不会比较 Kotlin 默认值,也不会执行初始化器。无论默认值为 null、`emptyList()` 还是非空列表,
+`NON_DEFAULT` 需要通过属性上的 `@JsonProperty` 或类上的 `@JsonInclude` 显式授权。
+只有**选定构造函数的每个参数都有语言默认值**,或模型使用普通无参构造函数时才支持。
+Fory 为每份已初始化的模型元数据构造一个参考对象并获取已授权属性的值,执行完整构造函数、
+所有初始化器和 `init` 块。此操作不会在每次写入时重复;未授权的模型不会构造参考对象。
+动态类型和声明类型的模型使用位置可能分别初始化。
+
+包含必需参数的模型会被拒绝,即使另一个构造函数恰好没有参数。Fory 不会伪造参数、
+借用第一个对象的参数、更改创建器选择、绕过构造函数或分析字节码。构造失败会报告模型和属性。
+全局 `defaultPropertyInclusion(NON_DEFAULT)` 会被拒绝。
+
+Kotlin 元数据只表明默认值是否存在,不揭示表达式或依赖关系。调用方必须确认默认值稳定、
+参考对象构造没有外部可见副作用,以及字段缺失时能恢复一致的值。
+固定参考对象无法表示依赖当前输入、时间、随机数或外部状态的默认值,应排除这些属性:
+
+```kotlin
+import org.apache.fory.json.annotation.JsonInclude
+import org.apache.fory.json.annotation.JsonProperty
+import org.apache.fory.json.annotation.JsonProperty.Include
+import org.apache.fory.json.kotlin.ForyJsonKotlin
+
+@JsonInclude(Include.NON_DEFAULT)
+data class Limits(
+ val low: Int = 1,
+ @param:JsonProperty(include = Include.ALWAYS) val high: Int = low + 1
+)
+
+val json = ForyJsonKotlin.builder().build()
+json.toJson(Limits()) // {"high":2}
+json.toJson(Limits(5, 2)) // {"low":5,"high":2}
+json.fromJson("""{"low":5}""", Limits::class.java) // Limits(5, 6)
+```
+
+当 `low=5` 时必须保留 `high=2`,否则会恢复为 `high=6`。参数依赖并非一概不安全,
+但固定参考对象无法提供其变化的上下文。若只授权个别属性,移除 `JsonInclude`,
+并在对应属性上添加 `@param:JsonProperty(include = Include.NON_DEFAULT)`。
+已注册的 Mixin 可以提供类或属性策略,无需修改模型。类级授权也覆盖未来新增的属性;
+维护者必须校验每个新增默认值,或通过 `ALWAYS` 排除。
+
+读取缺失字段时仍调用正常的 Kotlin 默认值。显式 null 不等于缺失。参考对象及其可变集合不会与
+解码对象共享。比较使用基本类型值、引用的 `equals` 契约及数组内容,见
+[默认值省略](annotations.md#jsoninclude-and-default-omission)。代码压缩时使用已有 JSON KSP 配置;
+默认值在运行时求值,不在 KSP 处理期间求值。
+
+无论默认值为 null、`emptyList()` 还是非空列表,
`NON_EMPTY` 都会省略空列表。非空值类不会因为底层字符串或集合为空而被当作空属性。
对于本身实现 `CharSequence`、`Collection` 或 `Map` 的未装箱值类,不支持显式的 `NON_EMPTY`;
这类模型应使用包含它的对象的自定义编解码器。
@@ -156,12 +221,15 @@ val text = json.toJson(Response(1, items = emptyList())) // {"id":1}
Kotlin 类型使用位置的可空性在根值、属性、容器元素、Map 值和泛型子类型上均会被检查:
-| 声明 | 成员缺失 | 显式 JSON `null` |
-| --------------------------------- | ---------- | ---------------- |
-| `val value: String` | 失败 | 失败 |
-| `val value: String?` | 失败 | 传入 null |
-| `val value: String = expression` | 求值默认值 | 失败 |
-| `val value: String? = expression` | 求值默认值 | 传入 null |
+| 声明 | 成员缺失 | 显式 JSON `null` |
+| --------------------------------- | ------------ | ---------------- |
+| `val value: String` | 失败 | 失败 |
+| `val value: String?` | 传入 null | 传入 null |
+| `val value: Int` | 使用 `0` | 失败 |
+| `val value: Boolean` | 使用 `false` | 失败 |
+| `val value: Int?` | 传入 null | 传入 null |
+| `val value: String = expression` | 求值默认值 | 失败 |
+| `val value: String? = expression` | 求值默认值 | 传入 null |
`List<String?>` 接受 null 元素,`List<String>` 拒绝 null 元素。Map 键必须非空。自动构造 Kotlin 模型时,不会猜测平台类型或未知的可空性。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/object-mapping.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/object-mapping.md
index 0193696c62e..94475fbffa9 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/object-mapping.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/object-mapping.md
@@ -130,17 +130,17 @@ Schema 仍应声明预期的 Java 类型。
这些内置值使用以下常规 JSON 形式:
-| Java 类型 | JSON 表示形式 |
+| Java 类型 | JSON 表示形式 |
| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
-| 布尔和数值标量 | 写入原生 JSON 布尔或数字;声明类型的目标也可读取带引号的相同 token 文本 |
-| Enum | 常量名称字符串 |
-| `Date`、`Calendar`、`java.sql.Date`、`Time`、`Timestamp` | 表示 epoch 毫秒数的数值 |
-| `TimeZone` | 时区 ID 字符串 |
-| Java 时间类型以及受支持的 chronology 日期类型 | 对应的标准文本形式字符串 |
+| 布尔和数值标量 | 写入原生 JSON 布尔或数字;声明类型的目标也可读取带引号的相同 token 文本 |
+| Enum | 常量名称字符串 |
+| `Date`、`Calendar`、`java.sql.Date`、`Time`、`Timestamp` | 表示 epoch 毫秒数的数值 |
+| `TimeZone` | 时区 ID 字符串 |
+| Java 时间类型以及受支持的 chronology 日期类型 | 对应的标准文本形式字符串 |
| `UUID`、`URI`、`File`、`Path`、`Locale`、`Charset`、`Currency`、`Pattern` | 对应类型的文本字符串;`File` 和 `Path` 使用路径文本,`Locale` 使用语言标签,`Pattern` 不保留 flags |
-| `BitSet` | 由有符号 `long` 字组成的数组,来源为 `BitSet.toLongArray()` |
-| `ByteBuffer` | 从 position 到 limit 的剩余范围所对应的有符号字节值数组 |
-| Optional 和原子包装类型 | 直接使用其中包含的标量、数组或值 |
+| `BitSet` | 由有符号 `long` 字组成的数组,来源为 `BitSet.toLongArray()` |
+| `ByteBuffer` | 从 position 到 limit 的剩余范围所对应的有符号字节值数组 |
+| Optional 和原子包装类型 | 直接使用其中包含的标量、数组或值 |
`Calendar` 会把 epoch 毫秒数读入新的 `GregorianCalendar`;不会保留原始日历子类型、时区和其他配置。
null `Optional` 引用和空 `Optional` 都会写为 JSON null;将 JSON null 读取为声明的 Optional 类型时,
@@ -194,24 +194,47 @@ ForyJson json = ForyJson.builder().defaultPropertyInclusion(Include.NON_EMPTY).b
```
`defaultPropertyInclusion` 和 `writeNullFields` 修改同一个设置,以最后一次调用为准。
-builder 接受 `ALWAYS`、`NON_NULL` 和 `NON_EMPTY`;`DEFAULT` 仅适用于属性注解。
-显式的 `JsonProperty.include` 优先于 builder 默认值。空值的定义与适用范围请参阅
+builder 接受 `ALWAYS`、`NON_NULL` 和 `NON_EMPTY`,拒绝 `DEFAULT` 和 `NON_DEFAULT`。
+省略默认值需要通过属性上的 `@JsonProperty(include = NON_DEFAULT)` 或类上的 `@JsonInclude(NON_DEFAULT)`
+显式授权;支持的默认值来源、构造与求值影响以及错误行为见[默认值省略](annotations.md#jsoninclude-and-default-omission)。
+属性上的 `JsonProperty.include` 优先于类上的 `JsonInclude`,后者优先于 builder 默认值。空值定义与适用范围见
[属性包含策略](annotations.md#jsonproperty)。
-| Builder 方法 | 默认值 | 用户可见的效果 |
-| -------------------------------------- | ----------------------------------------- | ---------------------------------------------- |
-| `defaultPropertyInclusion(Include)` | `NON_NULL` | 对象属性的默认包含策略 |
-| `writeNullFields(boolean)` | `false` | 为 true 时选择 `ALWAYS`,为 false 时选择 `NON_NULL` |
-| `writeLongAsString(boolean)` | `false` | 将内置 64 位整数值写为十进制字符串 |
-| `withCodegen(boolean)` | `true` | 启用生成的对象编解码器 |
-| `withAsyncCompilation(boolean)` | `true` | 异步编译生成的编解码器 |
-| `withFieldMode(boolean)` | `false` | 为 true 时,仅发现字段而不使用 getter/setter |
-| `withPropertyNamingStrategy(strategy)` | `LOWER_CAMEL_CASE` | 为未显式指定 `JsonProperty` 名称的属性命名 |
-| `withMaxCachedFieldNames(int)` | `DEFAULT_MAX_CACHED_FIELD_NAMES` (`8192`) | 每个 reader 的字段名缓存条目数;零表示禁用缓存 |
-| `withConcurrencyLevel(int)` | `max(1, 2 * processors)` | 根操作的最大并发数 |
-| `withBufferSizeLimitBytes(int)` | 2 MiB | 每个池化 writer 可保留的最大复用容量 |
-| `registerCodec(type, codec)` | None | 替换允许注册的精确类的完整 JSON 编解码器 |
-| `registerMixin(mixinType)` | None | 将一个注解 Mixin 应用于其精确声明的目标 |
+| Builder 方法 | 默认值 | 用户可见的效果 |
+| --------------------------------------- | ----------------------------------------- | --------------------------------------------------- |
+| `defaultPropertyInclusion(Include)` | `NON_NULL` | 对象属性的默认包含策略 |
+| `writeNullFields(boolean)` | `false` | 为 true 时选择 `ALWAYS`,为 false 时选择 `NON_NULL` |
+| `writeLongAsString(boolean)` | `false` | 将内置 64 位整数值写为十进制字符串 |
+| `escapeNonAscii(boolean)` | `false` | 将生成的 JSON 字符串和名称中的非 ASCII 字符转义 |
+| `byteArrayFormat(JsonByteArray.Format)` | `BASE64` | 字节数组读写的默认表示方式 |
+| `withCodegen(boolean)` | `true` | 启用生成的对象编解码器 |
+| `withAsyncCompilation(boolean)` | `true` | 异步编译生成的编解码器 |
+| `withFieldMode(boolean)` | `false` | 为 true 时,仅发现字段而不使用 getter/setter |
+| `withPropertyNamingStrategy(strategy)` | `LOWER_CAMEL_CASE` | 为未显式指定 `JsonProperty` 名称的属性命名 |
+| `withMaxCachedFieldNames(int)` | `DEFAULT_MAX_CACHED_FIELD_NAMES` (`8192`) | 每个 reader 的字段名缓存条目数;零表示禁用缓存 |
+| `withConcurrencyLevel(int)` | `max(1, 2 * processors)` | 根操作的最大并发数 |
+| `withBufferSizeLimitBytes(int)` | 2 MiB | 可保留的输出缓冲区或字符串解码缓冲区的最大容量 |
+| `registerCodec(type, codec)` | None | 替换允许注册的精确类的完整 JSON 编解码器 |
+| `registerMixin(mixinType)` | None | 将一个注解 Mixin 应用于其精确声明的目标 |
+
+使用 `byteArrayFormat` 为普通 `byte[]` 根值、未标注的属性及容器中的值选择统一表示,
+包括嵌套数组、集合、Map 和 Optional:
+
+```java
+import org.apache.fory.json.ForyJson;
+import org.apache.fory.json.annotation.JsonByteArray;
+
+ForyJson hexJson = ForyJson.builder().byteArrayFormat(JsonByteArray.Format.BASE16).build();
+String text = hexJson.toJson(new byte[] {1, -2, 3}); // "\"01fe03\""
+byte[] bytes = hexJson.fromJson(text, byte[].class);
+```
+
+默认的 `BASE64` 写入带填充符的标准 Base64 字符串。`BASE16` 写入不带前缀或分隔符的小写十六进制
+字符串,读取时接受大小写字母和 JSON 字符串转义,拒绝奇数长度和非十六进制字符。
+`ARRAY` 使用 `[-128, 127]` 范围内的有符号数字。空数组在字符串格式下写为 `""`,在 `ARRAY` 下写为 `[]`。
+三种格式都接受 JSON `null`。读取使用配置的表示方式,不猜测其他格式。
+[属性上的 `JsonByteArray` 注解](annotations.md#jsonbytearray)(包括 Mixin 提供的注解)覆盖全局默认值。
+声明位置上的自定义编解码器保留其完整表示;Kotlin 无符号语义数组仍使用数字数组。
当 64 位整数必须经过 JavaScript 且不能损失 `Number` 精度时,请启用 `writeLongAsString(true)`。
该设置会将内置 `long`/`Long`、`AtomicLong`、`AtomicLongArray` 和 `OptionalLong` 值写为带引号的
@@ -221,7 +244,7 @@ builder 接受 `ALWAYS`、`NON_NULL` 和 `NON_EMPTY`;`DEFAULT` 仅适用于属
并发级别和缓冲区保留限制必须为正数。字段名缓存上限分别应用于每个 reader;零会禁用该缓存。该上限
只限制缓存的字段名数量,不限制输入中可接受的名称。缓冲区保留设置不会限制 JSON 输入或输出大小,
-只限制一次操作结束后保留以供复用的 writer 存储空间。
+只限制一次操作后各个可复用输出缓冲区或字符串解码缓冲区的容量,不限制实例使用的总内存。
有关类加载、类型策略、嵌套深度、对象图内存限制和外部输入控制,请参阅
[Fory JSON 安全](security.md)。
@@ -229,3 +252,44 @@ builder 接受 `ALWAYS`、`NON_NULL` 和 `NON_EMPTY`;`DEFAULT` 仅适用于属
调用 `build()` 之后再修改 builder,不会改变已有的 `ForyJson` 实例。
在 Android 上禁用运行时代码生成和异步编译。GraalVM 原生镜像中无法进行运行时编译。Fory JSON 会为默认配置以及每个可达 `ForyJsonProvider` 配置下的可达模型生成编解码器。没有匹配生成编解码器的模型使用解释执行编解码器。其他 builder 选项保持上述行为。
+
+## 非 ASCII 转义 {#non-ascii-escaping}
+
+当接收方要求使用 JSON Unicode 转义表示非 ASCII 字符时,可以启用:
+
+```java
+import org.apache.fory.json.ForyJson;
+
+ForyJson json = ForyJson.builder().escapeNonAscii(true).build();
+String text = json.toJson("汉é"); // "\u6c49\u00e9"
+byte[] utf8 = json.toJsonBytes("汉é");
+```
+
+该选项适用于所有 String、UTF-8、流式和格式化写入 API 中的字符串和字符值、属性名、Map 键、
+枚举名和子类型名。U+007F 以上的字符使用小写十六进制转义,补充字符使用两个 UTF-16 代理项转义。
+JSON 必需的转义保持不变,字符串中的无效代理项序列仍会失败。
+`<`、`>` 和 `&` 等 ASCII 字符不会被额外转义。
+
+该设置默认为 `false`,实例构建后固定。需要交替使用不同输出策略时,应复用两个实例。
+格式化输出仍按次调用选择,读取行为不受影响。关闭此选项会保留既有输出表示,包括原有的转义。
+
+调用方提供的原始 JSON(包括 `@JsonRawValue`)会原样保留,因此包含原始 JSON 的文档仍可能含有
+非 ASCII 字符。自定义编解码器应使用结构化字符串写入方法以遵循该选项;直接写入原始内容的转义
+仍由编解码器作者负责。
+
+## 格式化输出 {#pretty-printing}
+
+可以为单次序列化调用选择便于阅读的输出:
+
+```java
+ForyJson json = ForyJson.builder().build();
+String text = json.toPrettyJson(value);
+byte[] utf8 = json.toPrettyJsonBytes(value);
+String compact = json.toJson(value);
+```
+
+格式与为对象和数组都配置两个空格缩进的 Jackson pretty printer 一致。每层容器增加一级缩进,
+冒号两侧各有一个空格。空对象和空数组分别为 `{ }` 和 `[ ]`,换行使用 `\n`,末尾没有换行。
+两个 API 均保留字符串的逻辑值,并遵循 `escapeNonAscii`。原始 JSON 值及其空白保持原样。
+读取同时接受紧凑和格式化 JSON。同一个实例可以按次切换输出格式;既有的
+`toJson`、`toJsonBytes` 和 `writeJsonTo` 继续输出紧凑 JSON。
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/scala.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/scala.md
index 277f3996fcc..ad6311ce5b1 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/scala.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/scala.md
@@ -24,7 +24,7 @@ Fory JSON 通过可选的 `fory-json-scala` 制品支持 Scala 2.13 和 Scala 3
## 设置 {#setup}
```sbt
-libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.4"
+libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.5"
```
`ForyJsonScala.builder()` 安装 Scala 模块并返回标准 Fory JSON builder:
@@ -40,16 +40,59 @@ val person = json.fromJson(text, classOf[Person])
```
请复用得到的 `ForyJson` 实例。它在构建后不可变且线程安全。
+使用 `ForyJsonScala.builder().escapeNonAscii(true)` 可在紧凑和格式化输出中转义非 ASCII 字符串内容与名称。
+该设置在实例构建后固定;原始 JSON 保持原样。见[非 ASCII 转义](object-mapping.md#non-ascii-escaping)。
+
使用 `ForyJsonScala.builder().writeLongAsString(true)` 可将 Scala `Long` 值以带引号的十进制字符串
输出,包括声明的 collection 和 Map 值、`Option[Long]`、以 `Long` 为底层值的值类以及 Java Long
类包装器。Reader 同时接受带引号和不带引号的整数 token。参数化声明包含 `Long` 时应使用
`ScalaTypeRef`,因为普通 JVM 签名可能会将 Scala 值类型参数擦除为 `Object`。
+## 字节数组格式 {#byte-array-formats}
+
+Scala `Array[Byte]` 默认使用 Base64 字符串。标准 builder 的 `byteArrayFormat` 可选择数字数组或
+十六进制字符串,也适用于 `Option`、Scala 集合和 Map 中的数组:
+
+```scala
+import org.apache.fory.json.annotation.JsonByteArray
+import org.apache.fory.json.scala.{ForyJsonScala, ScalaTypeRef}
+
+val hexJson = ForyJsonScala.builder().byteArrayFormat(JsonByteArray.Format.BASE16).build()
+val bytesType = ScalaTypeRef[Array[Byte]]
+val text = hexJson.toJson(Array[Byte](1, -2, 3), bytesType) // "\"01fe03\""
+val bytes = hexJson.fromJson(text, bytesType)
+```
+
+字段或 getter 上的 `JsonByteArray`(包括 Mixin)覆盖该属性的默认值。
+读写契约见[字节数组格式](object-mapping.md#builder-configuration)。
+
## Case class 与注解 {#case-classes-and-annotations}
-case class 通过调用完整主构造函数解码。对于缺失且有默认值的参数,Fory 调用 Scala 生成的构造函数默认值方法,不解析默认值表达式,也不修改构造函数 `val` 字段。后续参数列表中的默认值会按 Scala 语义接收前面已确定的构造函数参数。缺少无默认值的参数会报错。类体中的可变属性在构造后赋值。
+case class 通过调用完整主构造函数解码。对于缺失且有默认值的参数,Fory 调用 Scala 生成的构造函数默认值方法,
+不解析默认值表达式,也不修改构造函数 `val` 字段。后续参数列表中的默认值会按 Scala 语义接收前面的构造函数参数。
+构造函数参数没有显式默认值时,缺失属性使用类型默认值:
+
+- 数值使用零,Boolean 使用 `false`。
+- 集合、Map 和数组使用空值。每个对象的可变默认值相互独立。
+- `Option[A]` 使用 `None`。
+- 其他引用值(包括字符串和嵌套对象)使用 `null`。
+
+类体中的可变属性在缺失时保留初始化值,存在时在构造后赋值。
+
+```scala
+case class Options(value: Option[Int], selected: Option[Int] = Some(7))
+case class Profile(age: Int, enabled: Boolean, tags: List[String], name: String)
+
+json.fromJson("{}", classOf[Options]) // Options(None, Some(7))
+json.fromJson("""{"selected":null}""", classOf[Options]) // Options(None, None)
+json.fromJson("{}", classOf[Profile]) // Profile(0, false, List(), null)
+```
+
+显式构造函数默认值优先用于缺失的属性。显式 JSON `null` 对 `Option[A]` 解码为 `None`,
+即使其构造函数默认值为 `Some(...)` 也是如此。
case class 可以声明在顶层,也可以嵌套在任意层数的 `object` 内,但每一层外部作用域都必须是 `object`。如果外层是 `class`、trait 或方法,读写都会被拒绝,因为 Fory 无法访问重建值所需的外部实例或伴生对象。
+构造要求具有公共 JVM 构造函数以及匹配的公共伴生对象 `apply`;不支持的私有构造形式会被拒绝。
Fory JSON 注解可以直接放在 Scala 构造函数属性上:
@@ -66,10 +109,53 @@ case class Media(
`JsonIgnore` 适用于字段、属性方法、setter 参数和选定的构造函数参数。`JsonCodec` 子槽位绑定直接集合元素、`Option` 内容,以及 Map 键或值。其他 Fory JSON 注解保持[注解](annotations.md)中描述的行为。
-如果必需且没有默认值的引用参数使用了会省略 `null` 的包含规则,序列化会拒绝 null 值,以确保 Fory 写出的 JSON 仍可按同一个 case class Schema 读取。
-全局设置 `defaultPropertyInclusion(NON_EMPTY)` 会保留必需构造函数参数中的空值。
-如果必需参数的类型可能为空,显式的 `@JsonProperty(include = NON_EMPTY)` 会被拒绝;
-为该参数添加构造函数默认值后,才允许省略。
+属性包含策略控制写出的值。省略的属性在读取时使用构造函数或类型默认值,因此省略空字符串可能恢复为 `null`。
+如果需要保留区别,使用 `ALWAYS`。显式 JSON `null` 保持声明类型的常规 null 行为,不会请求构造函数默认值。
+
+`NON_EMPTY` 识别 `None` 和受支持的空严格求值 Scala 序列、集合、Map,包括可变集合和 range。
+过滤不递归:`Some("")`、`Some(Nil)`、`Some(null)` 和非空容器都会保留。
+它不会遍历惰性集合来判断是否为空,也不会移除根值、数组元素、Map 条目或元组位置。
+
+这些 Scala 编解码器实现 `isEmpty(writer, value)`。使用自定义编解码器替换它们时,需要重写该方法
+以保留所需的空值省略行为;默认返回 `false`。例如,没有重写该方法的自定义 Option 编解码器会在
+`NON_EMPTY` 下保留 `None` 属性。动态 `Any` 属性使用实际值选定的编解码器,属性专用的自定义
+编解码器控制自身空值检查。见[自定义空值](custom-codecs.md#custom-empty-values)。
+
+通过 `NON_DEFAULT` 显式授权稳定的声明默认值:
+
+```scala
+import org.apache.fory.json.annotation.JsonProperty.Include
+import org.apache.fory.json.annotation.{JsonInclude, JsonProperty}
+import org.apache.fory.json.scala.ForyJsonScala
+
+@JsonInclude(Include.NON_DEFAULT)
+case class Request(
+ @JsonProperty(include = Include.ALWAYS) id: Int,
+ retries: Int = 3,
+ tags: List[String] = Nil
+)
+
+val json = ForyJsonScala.builder().build()
+json.toJson(Request(0)) // {"id":0}
+json.fromJson("""{"id":0}""", classOf[Request]) // Request(0, 3, Nil)
+json.toJson(Request(0, retries = 0)) // {"id":0,"retries":0}
+```
+
+`id` 没有声明默认值,因此需要显式排除,否则类级授权会失败。读取时隐含的零、空集合或 `None`
+不是声明的默认值。也可移除类注解,只在选定的默认值属性上添加
+`@JsonProperty(include = Include.NON_DEFAULT)`。Mixin 支持两种形式;全局 `NON_DEFAULT` 会被拒绝。
+
+默认值表达式在写入时执行,必须具有确定性且没有外部可见副作用。
+对于 `case class Limits(low: Int)(val high: Int = low + 1)`,比较 `high` 时使用对象实际的 `low`。
+当 `low=5, high=2` 时会保留 high,因为默认值为 6。缺少默认值方法或写入 Schema 依赖时,
+模型初始化会失败。JVM 方法返回 `void` 的 `Unit` 默认值不能用作比较来源;
+授权整个类时,应通过 `ALWAYS` 保留这些属性。
+
+授权表示调用方确认缺失输入可以恢复相同上下文;Fory 不证明这一点或表达式的纯度。
+对于依赖时间、随机数或状态的默认值,应使用 `ALWAYS`。数组按内容比较,浮点数区分正零与负零。
+Scala 类体初始化器不会被推断为构造函数默认值。不同于默认值的值(包括 null 和空集合)仍会写出。
+读取行为独立,并创建新的可变默认值。类级授权也覆盖未来新增的字段,见
+[默认值省略](annotations.md#jsoninclude-and-default-omission)。
## 支持的 Scala 类型 {#supported-scala-types}
@@ -119,11 +205,53 @@ val rangeType = ScalaTypeRef[scala.collection.immutable.NumericRange[Int]]
val range = json.fromJson("[1,3,5,7]", rangeType)
```
+泛型 case class 保留类型参数,包括同一个类的有限嵌套:
+
+```scala
+case class Box[A](value: A)
+
+val boxType = ScalaTypeRef[Box[Box[Int]]]
+val box = json.fromJson("""{"value":{"value":1}}""", boxType)
+json.toJson(box, boxType) // {"value":{"value":1}}
+```
+
+持续扩张类型参数的递归声明(例如 `Node[A]` 包含 `Node[List[A]]`)需要自定义编解码器。
+`Unit` 根值应使用 `ScalaTypeRef[Unit]`:
+
+```scala
+val unitType = ScalaTypeRef[Unit]
+json.toJson((), unitType) // "null"
+json.fromJson("null", unitType) // ()
+```
+
+`Unit` 也支持 case class 字段及 `List[Unit]`、`Array[Unit]`、`Option[Unit]` 等嵌套类型。
+每个 `Unit` 值编码为 JSON `null`。由于 Option 使用值或 null 表示,`Some(())` 写为 `null` 后会读回 `None`。
+不要将 `classOf[Unit]` 传给 Java `Class` 重载:它表示 JVM `void`,作为根值写入时会被拒绝。
+
提供完整类型参数时,`Some[Int]` 是有效声明类型。非 null JSON 值解码为 `Some(value)`;`Some[Int]` 拒绝 JSON `null`,而 `Option[Int]` 将其解码为 `None`。
## Scala 2 Enumeration
-Scala 2 会从 `Enumeration#Value` 中擦除所属的 `Enumeration`。使用 `JsonEnumeration` 可在直接值、集合或数组元素、`Option` 内容以及 Map 键/值上保留其所属枚举:
+在 Scala 2.13 和 Scala 3 上,使用 `ScalaTypeRef` 保留静态已知的枚举所有者,
+包括数组、集合、Option 和 Map 中的枚举:
+
+```scala
+import org.apache.fory.json.scala.{ForyJsonScala, ScalaTypeRef}
+
+object Suit extends Enumeration {
+ val Hearts, Clubs = Value
+}
+
+val json = ForyJsonScala.builder().build()
+val suits = ScalaTypeRef[Array[Suit.Value]]
+val values = json.fromJson("""["Hearts","Clubs"]""", suits)
+val text = json.toJson(values, suits)
+```
+
+每个类型使用位置分别选定所有者,不同枚举可在同一运行时共存,无需为共享的 `Enumeration.Value` 类注册。
+保留所有者的类型别名也受支持。被擦除的 `Enumeration#Value`、`Class` 或普通 JVM `TypeRef` 无法恢复所有者。
+通过 JVM 反射发现的 case class 属性,如果签名已擦除所有者,需要使用 `JsonEnumeration`。
+该注解可用于直接值、集合或数组元素、`Option` 内容以及 Map 键/值:
```scala
import org.apache.fory.json.scala.JsonEnumeration
@@ -151,9 +279,61 @@ case class Schedule(
自定义编码表示时,扩展 `ScalaEnumerationCodec` 并通过 `@JsonCodec` 选择该编解码器。该编解码器也实现 Map 键契约,因此其类可用于 `keyCodec`。
+## 单例 sealed ADT {#singleton-sealed-adts}
+
+在 Scala 2.13 和 Scala 3 上,显式选择 `ScalaJsonCodec.stringEnum[T]`,
+可将由单例分支组成的封闭 sealed 类型层次编码为 JSON 字符串:
+
+```scala
+import org.apache.fory.json.scala.{ForyJsonScala, ScalaJsonCodec, ScalaTypeRef}
+
+sealed trait Color
+case object Red extends Color
+case object Blue extends Color
+
+val json = ForyJsonScala.builder()
+ .registerCodec(classOf[Color], ScalaJsonCodec.stringEnum[Color])
+ .build()
+val colors = ScalaTypeRef[Array[Color]]
+val text = json.toJson(Array[Color](Red, Blue), colors) // ["Red","Blue"]
+val values = json.fromJson(text, colors)
+```
+
+编译器发现分支及其名称,包括 sealed 中间分支下的分支,无需手写名称到成员的映射。
+开放抽象分支或包含构造函数参数的分支会在编译时被拒绝。未知输入名称会被拒绝,名称不会用于加载类,
+也不依赖重写的 `toString`。
+
+该表示需要显式选择。`ScalaJsonCodec.derived[T]` 保留包装对象表示,也支持显式注册的 Scala 2 sealed 层次。
+Scala 3 `derives` 和无参数 Scala 3 枚举的默认行为不变。`null` 仍表示为 JSON `null`。
+
+## 标量字符串 {#scalar-strings}
+
+在 Boolean 或数值属性上使用 `JsonFormat(shape = JsonFormat.Shape.STRING)`,
+可将标量 token 写为 JSON 字符串。读取同时接受字符串和原生标量 token:
+
+```scala
+import org.apache.fory.json.annotation.{JsonFormat, JsonMixin}
+import org.apache.fory.json.scala.ForyJsonScala
+
+case class Artifact(expired: Boolean, size: Long)
+
+@JsonMixin(target = classOf[Artifact])
+abstract class ArtifactMixin {
+ @JsonFormat(shape = JsonFormat.Shape.STRING) var expired: Boolean = false
+}
+
+val json = ForyJsonScala.builder().registerMixin(classOf[ArtifactMixin]).build()
+val text = json.toJson(Artifact(false, 7L)) // {"expired":"false","size":7}
+```
+
+也可以直接在构造函数属性上添加注解。Mixin 只使用 Fory 注解且不修改模型。
+除基本和装箱 Boolean/数值类型外,也支持 Scala `BigInt` 和 `BigDecimal`。
+null、非有限数及受支持的直接包装行为见[注解](annotations.md#jsonformat)。
+
## Scala 3 封闭枚举与 sealed 层次结构 {#scala-3-closed-enums-and-sealed-hierarchies}
-无参数的 Scala 3 枚举以分支名作为 JSON 字符串。对于带参数分支的枚举,添加 `derives ScalaJsonCodec`,即可为所有分支定义统一的封闭包装对象表示:
+无参数的 Scala 3 枚举以分支名作为 JSON 字符串,也可用作 `Map[Color, String]` 等有类型 Scala Map 的键。
+对于带参数分支的枚举,添加 `derives ScalaJsonCodec`,即可为所有分支定义统一的封闭包装对象表示:
```scala
import org.apache.fory.json.scala.*
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/security.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/security.md
index da20ee49564..9df26086112 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/security.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/json/security.md
@@ -64,7 +64,7 @@ ClassLoader。此后更改线程上下文 ClassLoader 不会影响该 `ForyJson`
内置计量包括 POJO 和 Record 的浅层存储,集合和 set 及候选元素引用槽位,Map 及候选键/值引用槽位,引用数组及其槽位,以及基本类型数组及其存储。自然 `JsonObject` 和 `JsonArray` 值遵循相同 Map 和集合规则。长度未知的集合、Map 和数组按 1024 项分批预留存储,在每批最后一个子元素之前及尾部执行。因此,重复 set 元素以及重复或被覆盖的 Map 成员,每次在输入中出现都会计量。即使所有元素都是叶子值,引用数组仍会计量;即使所有属性都是叶子值,对象也会计量。`AtomicReference`、`AtomicReferenceArray` 和泛型 `Optional<T>` 包含包装对象及引用存储。新分配的基本类型 Optional 或原子基本类型包装也会计量一次;缓存的空 Optional 单例不属于新的对象图所有者。
专用叶值 codec 不计入对象图:null、字符串、字符、布尔值、包括任意精度数在内的数值、枚举、
-时间及其他标量值,以及二进制值。由二进制或 Base64 codec 处理的 `byte[]` 仍是二进制叶值;
+时间及其他标量值,以及二进制值。由二进制、Base64 或 Base16 codec 处理的 `byte[]` 仍是二进制叶值;
从 JSON 数值数组读取的同一 Java 载体则是基本类型数组所有者。可用字节数和语法检查仍独立于对象图计量。
会实例化复合对象图所有者的自定义 codec,必须为每个复合应用对象、collection、Map 或引用数组调用
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/configuration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/configuration.md
index 68f97e86390..fe2231ac960 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/configuration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/configuration.md
@@ -136,7 +136,7 @@ auto fory = Fory::builder()
### max_schema_versions_per_type(uint32_t)
-设置一个逻辑类型可接受的远端元数据版本上限。
+设置一个逻辑类型可缓存的远端元数据版本上限。
```cpp
auto fory = Fory::builder()
@@ -146,6 +146,9 @@ auto fory = Fory::builder()
**Default:** `10`
+Schema 版本限制仅约束缓存的元数据。达到 Schema 版本或逻辑类型缓存上限后,有效数据仍会在完整
+元数据验证后反序列化,但不会缓存新 Schema。重复读取未缓存的 Schema 可能增加开销;既有缓存仍可复用。
+
### max_type_fields(uint32_t)
设置一个已接收远端结构体元数据主体可接受的最大字段数。
@@ -172,7 +175,7 @@ auto fory = Fory::builder()
### max_average_schema_versions_per_type(uint32_t)
-设置已接受远端类型的平均可接受远端元数据版本数。有效的全局下限为 `8192` 个 Schema。
+设置已缓存远端类型的平均可接受远端元数据版本数。有效的全局下限为 `8192` 个 Schema。
```cpp
auto fory = Fory::builder()
@@ -227,8 +230,8 @@ auto fory = Fory::builder().build_thread_safe(); // Returns ThreadSafeFory
| `max_dyn_depth(uint32_t)` | 动态类型的最大嵌套深度 | `5` |
| `max_type_fields(uint32_t)` | 一个已接收结构体元数据主体的最大字段数 | `512` |
| `max_type_meta_bytes(uint32_t)` | 一个已接收元数据主体的最大编码字节数 | `4096` |
-| `max_schema_versions_per_type(uint32_t)` | 一个逻辑类型的最大远端元数据版本数 | `10` |
-| `max_average_schema_versions_per_type(uint32_t)` | 各类型的平均远端元数据版本数 | `3` |
+| `max_schema_versions_per_type(uint32_t)` | 一个逻辑类型的最大缓存远端元数据版本数 | `10` |
+| `max_average_schema_versions_per_type(uint32_t)` | 各类型的平均缓存远端元数据版本数 | `3` |
| `check_struct_version(bool)` | 启用结构体版本检查 | `false` |
## 安全
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/index.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/index.md
index eeb42eb4a24..a8d57c2646c 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/index.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/index.md
@@ -60,7 +60,7 @@ include(FetchContent)
FetchContent_Declare(
fory
GIT_REPOSITORY https://github.com/apache/fory.git
- GIT_TAG v1.7.4
+ GIT_TAG v1.7.5
SOURCE_SUBDIR cpp
)
FetchContent_MakeAvailable(fory)
@@ -90,11 +90,11 @@ module(
bazel_dep(name = "rules_cc", version = "0.1.1")
-bazel_dep(name = "fory", version = "1.7.4")
+bazel_dep(name = "fory", version = "1.7.5")
git_override(
module_name = "fory",
remote = "https://github.com/apache/fory.git",
- commit = "v1.7.4", # Or use a specific commit hash for reproducibility
+ commit = "v1.7.5", # Or use a specific commit hash for reproducibility
)
```
@@ -125,7 +125,7 @@ bazel run //:my_app
本地开发时,可以改用 `local_path_override`:
```bazel
-bazel_dep(name = "fory", version = "1.7.4")
+bazel_dep(name = "fory", version = "1.7.5")
local_path_override(
module_name = "fory",
path = "/path/to/fory",
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/security.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/security.md
index 7771b5a4a79..6cf5d33cacd 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/security.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/cpp/security.md
@@ -39,7 +39,8 @@ license: |
- 对有意使用相同 Schema 的载荷,将 `check_struct_version(true)` 与 `compatible(false)` 配合使用。
- 对大多数输入,将 `max_graph_memory_bytes(...)` 保持为固定默认值 `128 MiB`;只有可信工作负载需要不同的集合/映射/结构体限制时才设置正值。
- 在模型允许范围内尽量降低 `max_dyn_depth(...)`,以拒绝意外过深的多态对象图。
-- 除非数据确定无恶意且可信对等端会发送更大的元数据或大量 Schema 版本,否则请保留远端 Schema 元数据限制的默认值。
+- 保持远程元数据大小限制的默认值,除非可信通信方需要更大的元数据。
+ Schema 版本限制只约束缓存;更多有效 Schema 会在不缓存的情况下解码。
- 对不可信输入,优先使用具体字段而非宽泛的多态字段。
## 验证
diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/csharp/configuration.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/csharp/configuration.md
index a6f39f8f575..9df9698a647 100644
--- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/csharp/configuration.md
+++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.7.0/object-serialization/csharp/configuration.md
@@ -44,8 +44,8 @@ ThreadSafeFory threadSafe = Fory.Builder().BuildThreadSafe();
| `MaxUnbackedContainerItems` | `8192` | 每次根值读取允许的无输入支撑 collection/map 工作量 |
| `MaxTypeFields` | `512` | 单个已接收结构体元数据主体的最大字段数 |
| `MaxTypeMetaBytes` | `4096` | 单个已接收元数据主体的最大编码字节数 |
-| `MaxSchemaVersionsPerType` | `10` | 单个逻辑类型的最大远程元数据版本数 |
-| `MaxAverageSchemaVersionsPerType` | `3` | 所有类型的平均远程元数据版本数 |
+| `MaxSchemaVersionsPerType` | `10` | 单个逻辑类型的最大缓存远程元数据版本数 |
+| `MaxAverageSchemaVersionsPerType` | `3` | 所有类型的平均缓存远程元数据版本数 |
## 构建器选项
@@ -138,7 +138,7 @@ Fory fory = Fory.Builder()
### `MaxSchemaVersionsPerType(int value)`
-设置单个逻辑类型允许的最大远程元数据版本数。
+设置单个逻辑类型可缓存的最大缓存远程元数据版本数。
```csharp
Fory fory = Fory.Builder()
@@ -146,9 +146,12 @@ Fory fory = Fory.Builder()
.Build();
```
... 6075 lines suppressed ...
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org