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
commit 4d9646387ebb86e87c88d3e0c052d78408a2cdad Author: chaokunyang <[email protected]> AuthorDate: Mon Aug 3 18:26:42 2026 +0000 🔄 synced local 'docs/benchmarks/' with remote 'docs/benchmarks/' --- docs/benchmarks/_category_.json | 6 + docs/benchmarks/index.md | 133 +++++++++++++++++++++ docs/benchmarks/json/_category_.json | 6 + docs/benchmarks/{java/json => json/java}/README.md | 0 .../{java/json => json/java}/string_throughput.png | Bin .../json => json/java}/utf8_bytes_throughput.png | Bin docs/benchmarks/methodology.md | 42 +++++++ .../object-serialization/_category_.json | 6 + .../object-serialization/native/_category_.json | 6 + .../object-serialization/native/java-graalvm.md | 110 +++++++++++++++++ .../native}/java/README.md | 32 +---- .../java/data/jmh-jdk-11-deserialization.csv | 0 .../native}/java/data/jmh-jdk-11-serialization.csv | 0 .../native}/java/data/jmh-jdk-11-zerocopy.csv | 0 .../java/java_heap_deserialize_compatible.png | Bin .../java/java_heap_deserialize_consistent.png | Bin .../java/java_heap_serialize_compatible.png | Bin .../java/java_heap_serialize_consistent.png | Bin .../java/java_offheap_deserialize_compatible.png | Bin .../java/java_offheap_deserialize_consistent.png | Bin .../java/java_offheap_serialize_compatible.png | Bin .../java/java_offheap_serialize_consistent.png | Bin .../java/java_repo_deserialization_throughput.png | Bin .../java/java_repo_serialization_throughput.png | Bin .../native}/java/java_zero_copy_deserialize.png | Bin .../native}/java/java_zero_copy_serialize.png | Bin .../object-serialization/xlang/_category_.json | 6 + .../{ => object-serialization/xlang}/cpp/README.md | 0 .../xlang}/cpp/throughput.png | Bin .../xlang}/csharp/README.md | 0 .../xlang}/csharp/throughput.png | Bin .../xlang}/dart/README.md | 0 .../xlang}/dart/throughput.png | Bin .../{ => object-serialization/xlang}/go/README.md | 0 .../xlang}/go/benchmark_results.txt | 0 .../xlang}/go/serialized_sizes.txt | 0 .../xlang}/go/throughput.png | Bin .../object-serialization/xlang/java/README.md | 52 ++++++++ .../xlang}/java/throughput.png | Bin .../xlang}/javascript/README.md | 0 .../xlang}/javascript/throughput.png | Bin .../xlang}/python/README.md | 0 .../xlang}/python/throughput.png | Bin .../xlang}/rust/README.md | 0 .../xlang}/rust/throughput.png | Bin .../xlang}/swift/README.md | 0 .../xlang}/swift/throughput.png | Bin 47 files changed, 369 insertions(+), 30 deletions(-) diff --git a/docs/benchmarks/_category_.json b/docs/benchmarks/_category_.json new file mode 100644 index 0000000000..c87e2b8ded --- /dev/null +++ b/docs/benchmarks/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 3, + "label": "Benchmarks", + "collapsible": true, + "collapsed": true +} diff --git a/docs/benchmarks/index.md b/docs/benchmarks/index.md new file mode 100644 index 0000000000..46af48783d --- /dev/null +++ b/docs/benchmarks/index.md @@ -0,0 +1,133 @@ +--- +title: Benchmarks +sidebar_position: 1 +id: index +license: | + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--- + +> **Note**: Different serializers and configurations excel in different workloads. Benchmark results are for reference only. +> For your specific use case, conduct benchmarks with appropriate configurations and workloads. + +## Java Benchmark + +The Java benchmark section compares Fory against popular Java serialization frameworks using the current benchmark suite from `docs/benchmarks/object-serialization/native/java`. + +**Serialization Throughput**: + + + +**Deserialization Throughput**: + + + +**JSON Throughput**: + +<div style={{display: 'flex', gap: '1rem'}}> + <img src={require('./json/java/string_throughput.png').default} alt="Java JSON String Throughput" style={{width: 'calc(50% - 0.5rem)'}} /> + <img src={require('./json/java/utf8_bytes_throughput.png').default} alt="Java JSON UTF-8 Throughput" style={{width: 'calc(50% - 0.5rem)'}} /> +</div> + +**Cross-Language Throughput**: + + + +**Important**: Fory's runtime code generation requires proper warm-up for performance measurement: + +For additional benchmark notes, raw data, and the complete Java benchmark README, see [Java Benchmarks](object-serialization/native/java/README.md). + +## Python Benchmark + +Fory Python demonstrates strong performance compared to `pickle` and Protobuf across object and list workloads. + + + +For benchmark setup, raw results, and reproduction steps, see [Python Benchmarks](object-serialization/xlang/python/README.md). + +## Rust Benchmark + +Fory Rust demonstrates competitive performance compared to other Rust serialization frameworks. + + + +Note: Results depend on hardware, dataset, and implementation versions. See the +[Rust benchmark report](object-serialization/xlang/rust/README.md) for the recorded environment, +workloads, and reproduction command. + +## C++ Benchmark + +Fory C++ demonstrates competitive performance compared to Protobuf C++ serialization framework. + + + +See the [C++ benchmark report](object-serialization/xlang/cpp/README.md) for the recorded +environment, workloads, and reproduction command. + +## Go Benchmark + +Fory Go demonstrates strong performance compared to Protobuf and Msgpack across +single-object and list workloads. + + + +Note: Results depend on hardware, dataset, and implementation versions. See the +[Go benchmark report](object-serialization/xlang/go/README.md) for details. + +## C# Benchmark + +Fory C# demonstrates strong performance compared to Protobuf and Msgpack across +typed object serialization and deserialization workloads. + + + +Note: Results depend on hardware and runtime versions. See the +[C# benchmark report](object-serialization/xlang/csharp/README.md) for details. + +## Swift Benchmark + +Fory Swift demonstrates strong performance compared to Protobuf and Msgpack +across both scalar-object and list workloads. + + + +Note: Results depend on hardware and runtime versions. See the +[Swift benchmark report](object-serialization/xlang/swift/README.md) for details. + +## JavaScript Benchmark + +Fory JavaScript demonstrates strong performance compared to Protocol Buffers and +JSON across representative Node.js workloads. + + + +Note: Results depend on hardware, dataset, and runtime versions. See the +[JavaScript benchmark report](object-serialization/xlang/javascript/README.md) for details. + +## Dart Benchmark + +Fory Dart demonstrates strong performance compared to Protocol Buffers across +representative object and list workloads. + + + +Note: Results depend on hardware, dataset, and runtime versions. See the +[Dart benchmark report](object-serialization/xlang/dart/README.md) for details. + +## Read Results Responsibly + +Start with [Methodology](methodology.md), then open the report whose capability, runtime, schema, +mode, and operation match your workload. The checked-in results are historical evidence from their +recorded environment, not a guarantee for a different application or current main branch. diff --git a/docs/benchmarks/json/_category_.json b/docs/benchmarks/json/_category_.json new file mode 100644 index 0000000000..d6cdf1f1b1 --- /dev/null +++ b/docs/benchmarks/json/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 4, + "label": "Fory JSON", + "collapsible": true, + "collapsed": true +} diff --git a/docs/benchmarks/java/json/README.md b/docs/benchmarks/json/java/README.md similarity index 100% rename from docs/benchmarks/java/json/README.md rename to docs/benchmarks/json/java/README.md diff --git a/docs/benchmarks/java/json/string_throughput.png b/docs/benchmarks/json/java/string_throughput.png similarity index 100% rename from docs/benchmarks/java/json/string_throughput.png rename to docs/benchmarks/json/java/string_throughput.png diff --git a/docs/benchmarks/java/json/utf8_bytes_throughput.png b/docs/benchmarks/json/java/utf8_bytes_throughput.png similarity index 100% rename from docs/benchmarks/java/json/utf8_bytes_throughput.png rename to docs/benchmarks/json/java/utf8_bytes_throughput.png diff --git a/docs/benchmarks/methodology.md b/docs/benchmarks/methodology.md new file mode 100644 index 0000000000..4cf3f2cc31 --- /dev/null +++ b/docs/benchmarks/methodology.md @@ -0,0 +1,42 @@ +--- +title: Benchmark Methodology +sidebar_position: 2 +id: methodology +license: | + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--- + +A useful serialization benchmark records enough context to reproduce the workload and avoid +comparing different semantics as if they were equivalent. + +## Required context + +- repository commit and dependency versions; +- hardware, operating system, runtime version, and relevant environment variables; +- schema and object population; +- xlang or native mode, compatibility mode, reference tracking, and registration; +- warm-up, forks/processes, iterations, duration, and concurrency; +- serialized representation and operation measured; +- exact command and raw result location. + +## Interpret the reports + +Compare one operation and equivalent data semantics. Do not compare an xlang payload with a native +payload or a full object reconstruction with Row Format field access without naming that semantic +difference. JIT- and codegen-based runtimes require representative warm-up. + +Run the active benchmark harness for decisions that depend on current code. Checked-in reports are +evidence for the commit and environment they record. diff --git a/docs/benchmarks/object-serialization/_category_.json b/docs/benchmarks/object-serialization/_category_.json new file mode 100644 index 0000000000..517dab897e --- /dev/null +++ b/docs/benchmarks/object-serialization/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 3, + "label": "Object Serialization", + "collapsible": true, + "collapsed": true +} diff --git a/docs/benchmarks/object-serialization/native/_category_.json b/docs/benchmarks/object-serialization/native/_category_.json new file mode 100644 index 0000000000..1baf4a4d97 --- /dev/null +++ b/docs/benchmarks/object-serialization/native/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 2, + "label": "Native", + "collapsible": true, + "collapsed": true +} diff --git a/docs/benchmarks/object-serialization/native/java-graalvm.md b/docs/benchmarks/object-serialization/native/java-graalvm.md new file mode 100644 index 0000000000..d0f743a365 --- /dev/null +++ b/docs/benchmarks/object-serialization/native/java-graalvm.md @@ -0,0 +1,110 @@ +# Java GraalVM Native Image Benchmark + +These measurements cover Fory binary object serialization in GraalVM Native Image. Results depend on the recorded workloads and environment. + +## Benchmark + +Performance comparison between Fory and GraalVM JDK Serialization: + +| Type | Compression | Speed | Size | +| ------ | ----------- | ---------- | ---- | +| Struct | Off | 46x faster | 43% | +| Struct | On | 24x faster | 31% | +| Pojo | Off | 12x faster | 56% | +| Pojo | On | 12x faster | 48% | + +See [Benchmark.java](https://github.com/apache/fory/blob/main/integration_tests/graalvm_tests/src/main/java/org/apache/fory/graalvm/Benchmark.java) for benchmark code. + +### Struct Benchmark + +#### Class Fields + +```java +public class Struct implements Serializable { + public int f1; + public long f2; + public float f3; + public double f4; + public int f5; + public long f6; + public float f7; + public double f8; + public int f9; + public long f10; + public float f11; + public double f12; +} +``` + +#### Benchmark Results + +No compression: + +``` +Benchmark repeat number: 400000 +Object type: class org.apache.fory.graalvm.Struct +Compress number: false +Fory size: 76.0 +JDK size: 178.0 +Fory serialization took mills: 49 +JDK serialization took mills: 2254 +Compare speed: Fory is 45.70x speed of JDK +Compare size: Fory is 0.43x size of JDK +``` + +Compress number: + +``` +Benchmark repeat number: 400000 +Object type: class org.apache.fory.graalvm.Struct +Compress number: true +Fory size: 55.0 +JDK size: 178.0 +Fory serialization took mills: 130 +JDK serialization took mills: 3161 +Compare speed: Fory is 24.16x speed of JDK +Compare size: Fory is 0.31x size of JDK +``` + +### Pojo Benchmark + +#### Class Fields + +```java +public class Foo implements Serializable { + int f1; + String f2; + List<String> f3; + Map<String, Long> f4; +} +``` + +#### Benchmark Results + +No compression: + +``` +Benchmark repeat number: 400000 +Object type: class org.apache.fory.graalvm.Foo +Compress number: false +Fory size: 541.0 +JDK size: 964.0 +Fory serialization took mills: 1663 +JDK serialization took mills: 16266 +Compare speed: Fory is 12.19x speed of JDK +Compare size: Fory is 0.56x size of JDK +``` + +Compress number: + +``` +Benchmark repeat number: 400000 +Object type: class org.apache.fory.graalvm.Foo +Compress number: true +Fory size: 459.0 +JDK size: 964.0 +Fory serialization took mills: 1289 +JDK serialization took mills: 15069 +Compare speed: Fory is 12.11x speed of JDK +Compare size: Fory is 0.48x size of JDK +``` diff --git a/docs/benchmarks/java/README.md b/docs/benchmarks/object-serialization/native/java/README.md similarity index 90% rename from docs/benchmarks/java/README.md rename to docs/benchmarks/object-serialization/native/java/README.md index ba955ceb8a..8be666c449 100644 --- a/docs/benchmarks/java/README.md +++ b/docs/benchmarks/object-serialization/native/java/README.md @@ -1,6 +1,6 @@ -# Java Benchmarks +# Java Native Serialization Benchmarks -See the [Java JSON benchmark report](json/) for fory-json, Jackson, and Gson results. +See the [Java JSON benchmark report](../../../json/java/README.md) for fory-json, Jackson, and Gson results. ## System Environment @@ -239,31 +239,3 @@ But if you serialize data between processes on same node and use shared-memory, | deserialize | 5000 | array | PRIMITIVE_ARRAY | 40312.590172 | 6122.351228 | 10672.872798 | | deserialize | 5000 | directBuffer | BUFFER | 3284441.570594 | 148614.476829 | 77950.612503 | | deserialize | 5000 | directBuffer | PRIMITIVE_ARRAY | 40413.743717 | 21826.040410 | 8561.694533 | - -## Xlang Benchmark - -Run from `benchmarks/java/run.sh`. Raw JMH JSON stays under the ignored local `benchmarks/java/reports/` directory; `throughput.png` and this xlang section are synced into `docs/benchmarks/java/`. - -```bash -cd benchmarks/java -./run.sh -``` - -JMH parameters: `-f 1 -wi 3 -i 3 -t 1 -w 3s -r 3s -bm thrpt -tu s`. Higher throughput is better. - - - -| Data type | Operation | Fory ops/sec | Protobuf ops/sec | Flatbuffer ops/sec | Fastest | -| ----------------- | ----------- | ------------ | ---------------- | ------------------ | ------- | -| NumericStruct | Serialize | 46,787,647 | 33,024,161 | 9,612,018 | Fory | -| NumericStruct | Deserialize | 71,683,707 | 29,837,931 | 40,514,436 | Fory | -| Sample | Serialize | 17,406,902 | 2,071,963 | 3,153,672 | Fory | -| Sample | Deserialize | 17,772,123 | 1,867,967 | 4,179,494 | Fory | -| MediaContent | Serialize | 10,783,325 | 1,781,338 | 1,444,737 | Fory | -| MediaContent | Deserialize | 7,950,203 | 2,184,597 | 3,453,985 | Fory | -| NumericStructList | Serialize | 21,263,673 | 2,511,081 | 3,047,836 | Fory | -| NumericStructList | Deserialize | 19,249,877 | 2,067,204 | 8,168,569 | Fory | -| SampleList | Serialize | 4,580,165 | 401,280 | 696,268 | Fory | -| SampleList | Deserialize | 3,811,985 | 344,945 | 773,625 | Fory | -| MediaContentList | Serialize | 1,657,717 | 353,717 | 296,868 | Fory | -| MediaContentList | Deserialize | 1,111,043 | 435,956 | 516,192 | Fory | diff --git a/docs/benchmarks/java/data/jmh-jdk-11-deserialization.csv b/docs/benchmarks/object-serialization/native/java/data/jmh-jdk-11-deserialization.csv similarity index 100% rename from docs/benchmarks/java/data/jmh-jdk-11-deserialization.csv rename to docs/benchmarks/object-serialization/native/java/data/jmh-jdk-11-deserialization.csv diff --git a/docs/benchmarks/java/data/jmh-jdk-11-serialization.csv b/docs/benchmarks/object-serialization/native/java/data/jmh-jdk-11-serialization.csv similarity index 100% rename from docs/benchmarks/java/data/jmh-jdk-11-serialization.csv rename to docs/benchmarks/object-serialization/native/java/data/jmh-jdk-11-serialization.csv diff --git a/docs/benchmarks/java/data/jmh-jdk-11-zerocopy.csv b/docs/benchmarks/object-serialization/native/java/data/jmh-jdk-11-zerocopy.csv similarity index 100% rename from docs/benchmarks/java/data/jmh-jdk-11-zerocopy.csv rename to docs/benchmarks/object-serialization/native/java/data/jmh-jdk-11-zerocopy.csv diff --git a/docs/benchmarks/java/java_heap_deserialize_compatible.png b/docs/benchmarks/object-serialization/native/java/java_heap_deserialize_compatible.png similarity index 100% rename from docs/benchmarks/java/java_heap_deserialize_compatible.png rename to docs/benchmarks/object-serialization/native/java/java_heap_deserialize_compatible.png diff --git a/docs/benchmarks/java/java_heap_deserialize_consistent.png b/docs/benchmarks/object-serialization/native/java/java_heap_deserialize_consistent.png similarity index 100% rename from docs/benchmarks/java/java_heap_deserialize_consistent.png rename to docs/benchmarks/object-serialization/native/java/java_heap_deserialize_consistent.png diff --git a/docs/benchmarks/java/java_heap_serialize_compatible.png b/docs/benchmarks/object-serialization/native/java/java_heap_serialize_compatible.png similarity index 100% rename from docs/benchmarks/java/java_heap_serialize_compatible.png rename to docs/benchmarks/object-serialization/native/java/java_heap_serialize_compatible.png diff --git a/docs/benchmarks/java/java_heap_serialize_consistent.png b/docs/benchmarks/object-serialization/native/java/java_heap_serialize_consistent.png similarity index 100% rename from docs/benchmarks/java/java_heap_serialize_consistent.png rename to docs/benchmarks/object-serialization/native/java/java_heap_serialize_consistent.png diff --git a/docs/benchmarks/java/java_offheap_deserialize_compatible.png b/docs/benchmarks/object-serialization/native/java/java_offheap_deserialize_compatible.png similarity index 100% rename from docs/benchmarks/java/java_offheap_deserialize_compatible.png rename to docs/benchmarks/object-serialization/native/java/java_offheap_deserialize_compatible.png diff --git a/docs/benchmarks/java/java_offheap_deserialize_consistent.png b/docs/benchmarks/object-serialization/native/java/java_offheap_deserialize_consistent.png similarity index 100% rename from docs/benchmarks/java/java_offheap_deserialize_consistent.png rename to docs/benchmarks/object-serialization/native/java/java_offheap_deserialize_consistent.png diff --git a/docs/benchmarks/java/java_offheap_serialize_compatible.png b/docs/benchmarks/object-serialization/native/java/java_offheap_serialize_compatible.png similarity index 100% rename from docs/benchmarks/java/java_offheap_serialize_compatible.png rename to docs/benchmarks/object-serialization/native/java/java_offheap_serialize_compatible.png diff --git a/docs/benchmarks/java/java_offheap_serialize_consistent.png b/docs/benchmarks/object-serialization/native/java/java_offheap_serialize_consistent.png similarity index 100% rename from docs/benchmarks/java/java_offheap_serialize_consistent.png rename to docs/benchmarks/object-serialization/native/java/java_offheap_serialize_consistent.png diff --git a/docs/benchmarks/java/java_repo_deserialization_throughput.png b/docs/benchmarks/object-serialization/native/java/java_repo_deserialization_throughput.png similarity index 100% rename from docs/benchmarks/java/java_repo_deserialization_throughput.png rename to docs/benchmarks/object-serialization/native/java/java_repo_deserialization_throughput.png diff --git a/docs/benchmarks/java/java_repo_serialization_throughput.png b/docs/benchmarks/object-serialization/native/java/java_repo_serialization_throughput.png similarity index 100% rename from docs/benchmarks/java/java_repo_serialization_throughput.png rename to docs/benchmarks/object-serialization/native/java/java_repo_serialization_throughput.png diff --git a/docs/benchmarks/java/java_zero_copy_deserialize.png b/docs/benchmarks/object-serialization/native/java/java_zero_copy_deserialize.png similarity index 100% rename from docs/benchmarks/java/java_zero_copy_deserialize.png rename to docs/benchmarks/object-serialization/native/java/java_zero_copy_deserialize.png diff --git a/docs/benchmarks/java/java_zero_copy_serialize.png b/docs/benchmarks/object-serialization/native/java/java_zero_copy_serialize.png similarity index 100% rename from docs/benchmarks/java/java_zero_copy_serialize.png rename to docs/benchmarks/object-serialization/native/java/java_zero_copy_serialize.png diff --git a/docs/benchmarks/object-serialization/xlang/_category_.json b/docs/benchmarks/object-serialization/xlang/_category_.json new file mode 100644 index 0000000000..d2418b5e5e --- /dev/null +++ b/docs/benchmarks/object-serialization/xlang/_category_.json @@ -0,0 +1,6 @@ +{ + "position": 1, + "label": "Xlang", + "collapsible": true, + "collapsed": true +} diff --git a/docs/benchmarks/cpp/README.md b/docs/benchmarks/object-serialization/xlang/cpp/README.md similarity index 100% rename from docs/benchmarks/cpp/README.md rename to docs/benchmarks/object-serialization/xlang/cpp/README.md diff --git a/docs/benchmarks/cpp/throughput.png b/docs/benchmarks/object-serialization/xlang/cpp/throughput.png similarity index 100% rename from docs/benchmarks/cpp/throughput.png rename to docs/benchmarks/object-serialization/xlang/cpp/throughput.png diff --git a/docs/benchmarks/csharp/README.md b/docs/benchmarks/object-serialization/xlang/csharp/README.md similarity index 100% rename from docs/benchmarks/csharp/README.md rename to docs/benchmarks/object-serialization/xlang/csharp/README.md diff --git a/docs/benchmarks/csharp/throughput.png b/docs/benchmarks/object-serialization/xlang/csharp/throughput.png similarity index 100% rename from docs/benchmarks/csharp/throughput.png rename to docs/benchmarks/object-serialization/xlang/csharp/throughput.png diff --git a/docs/benchmarks/dart/README.md b/docs/benchmarks/object-serialization/xlang/dart/README.md similarity index 100% rename from docs/benchmarks/dart/README.md rename to docs/benchmarks/object-serialization/xlang/dart/README.md diff --git a/docs/benchmarks/dart/throughput.png b/docs/benchmarks/object-serialization/xlang/dart/throughput.png similarity index 100% rename from docs/benchmarks/dart/throughput.png rename to docs/benchmarks/object-serialization/xlang/dart/throughput.png diff --git a/docs/benchmarks/go/README.md b/docs/benchmarks/object-serialization/xlang/go/README.md similarity index 100% rename from docs/benchmarks/go/README.md rename to docs/benchmarks/object-serialization/xlang/go/README.md diff --git a/docs/benchmarks/go/benchmark_results.txt b/docs/benchmarks/object-serialization/xlang/go/benchmark_results.txt similarity index 100% rename from docs/benchmarks/go/benchmark_results.txt rename to docs/benchmarks/object-serialization/xlang/go/benchmark_results.txt diff --git a/docs/benchmarks/go/serialized_sizes.txt b/docs/benchmarks/object-serialization/xlang/go/serialized_sizes.txt similarity index 100% rename from docs/benchmarks/go/serialized_sizes.txt rename to docs/benchmarks/object-serialization/xlang/go/serialized_sizes.txt diff --git a/docs/benchmarks/go/throughput.png b/docs/benchmarks/object-serialization/xlang/go/throughput.png similarity index 100% rename from docs/benchmarks/go/throughput.png rename to docs/benchmarks/object-serialization/xlang/go/throughput.png diff --git a/docs/benchmarks/object-serialization/xlang/java/README.md b/docs/benchmarks/object-serialization/xlang/java/README.md new file mode 100644 index 0000000000..1330697fd7 --- /dev/null +++ b/docs/benchmarks/object-serialization/xlang/java/README.md @@ -0,0 +1,52 @@ +# Java Xlang Serialization Benchmarks + +See the [Java JSON benchmark report](../../../json/java/README.md) for fory-json, Jackson, and Gson results. + +This report covers the xlang benchmark groups generated by +`benchmarks/java/run.sh`. It does not inherit the environment or native-mode +workloads recorded in the separate [Java native report](../../native/java/README.md). +The checked-in xlang snapshot did not record its host, Fory commit, or dependency +versions; rerun the benchmark before using these results for a current comparison. + +See [Benchmark Methodology](../../../methodology.md) for the metadata required by +new or refreshed reports. + +## Workloads + +- `NumericStruct`: primitive numeric fields. +- `Sample`: the model used by the [Kryo benchmark suite](https://github.com/EsotericSoftware/kryo/blob/master/benchmarks/src/main/java/com/esotericsoftware/kryo/benchmarks/data/Sample.java). +- `MediaContent`: the media model from [jvm-serializers](https://github.com/eishay/jvm-serializers/blob/master/tpc/src/data/media/MediaContent.java). +- `*List`: a list of the corresponding model. + +## Run the Benchmark + +Run from `benchmarks/java/run.sh`. Raw JMH JSON stays under the ignored local +`benchmarks/java/reports/` directory; `throughput.png` and this xlang report are +published under `docs/benchmarks/object-serialization/xlang/java/`. + +```bash +cd benchmarks/java +./run.sh +``` + +JMH parameters: `-f 1 -wi 3 -i 3 -t 1 -w 3s -r 3s -bm thrpt -tu s`. Do not +skip warmup. Higher throughput is better. + +## Results + + + +| Data type | Operation | Fory ops/sec | Protobuf ops/sec | Flatbuffer ops/sec | Fastest | +| ----------------- | ----------- | ------------ | ---------------- | ------------------ | ------- | +| NumericStruct | Serialize | 46,787,647 | 33,024,161 | 9,612,018 | Fory | +| NumericStruct | Deserialize | 71,683,707 | 29,837,931 | 40,514,436 | Fory | +| Sample | Serialize | 17,406,902 | 2,071,963 | 3,153,672 | Fory | +| Sample | Deserialize | 17,772,123 | 1,867,967 | 4,179,494 | Fory | +| MediaContent | Serialize | 10,783,325 | 1,781,338 | 1,444,737 | Fory | +| MediaContent | Deserialize | 7,950,203 | 2,184,597 | 3,453,985 | Fory | +| NumericStructList | Serialize | 21,263,673 | 2,511,081 | 3,047,836 | Fory | +| NumericStructList | Deserialize | 19,249,877 | 2,067,204 | 8,168,569 | Fory | +| SampleList | Serialize | 4,580,165 | 401,280 | 696,268 | Fory | +| SampleList | Deserialize | 3,811,985 | 344,945 | 773,625 | Fory | +| MediaContentList | Serialize | 1,657,717 | 353,717 | 296,868 | Fory | +| MediaContentList | Deserialize | 1,111,043 | 435,956 | 516,192 | Fory | diff --git a/docs/benchmarks/java/throughput.png b/docs/benchmarks/object-serialization/xlang/java/throughput.png similarity index 100% rename from docs/benchmarks/java/throughput.png rename to docs/benchmarks/object-serialization/xlang/java/throughput.png diff --git a/docs/benchmarks/javascript/README.md b/docs/benchmarks/object-serialization/xlang/javascript/README.md similarity index 100% rename from docs/benchmarks/javascript/README.md rename to docs/benchmarks/object-serialization/xlang/javascript/README.md diff --git a/docs/benchmarks/javascript/throughput.png b/docs/benchmarks/object-serialization/xlang/javascript/throughput.png similarity index 100% rename from docs/benchmarks/javascript/throughput.png rename to docs/benchmarks/object-serialization/xlang/javascript/throughput.png diff --git a/docs/benchmarks/python/README.md b/docs/benchmarks/object-serialization/xlang/python/README.md similarity index 100% rename from docs/benchmarks/python/README.md rename to docs/benchmarks/object-serialization/xlang/python/README.md diff --git a/docs/benchmarks/python/throughput.png b/docs/benchmarks/object-serialization/xlang/python/throughput.png similarity index 100% rename from docs/benchmarks/python/throughput.png rename to docs/benchmarks/object-serialization/xlang/python/throughput.png diff --git a/docs/benchmarks/rust/README.md b/docs/benchmarks/object-serialization/xlang/rust/README.md similarity index 100% rename from docs/benchmarks/rust/README.md rename to docs/benchmarks/object-serialization/xlang/rust/README.md diff --git a/docs/benchmarks/rust/throughput.png b/docs/benchmarks/object-serialization/xlang/rust/throughput.png similarity index 100% rename from docs/benchmarks/rust/throughput.png rename to docs/benchmarks/object-serialization/xlang/rust/throughput.png diff --git a/docs/benchmarks/swift/README.md b/docs/benchmarks/object-serialization/xlang/swift/README.md similarity index 100% rename from docs/benchmarks/swift/README.md rename to docs/benchmarks/object-serialization/xlang/swift/README.md diff --git a/docs/benchmarks/swift/throughput.png b/docs/benchmarks/object-serialization/xlang/swift/throughput.png similarity index 100% rename from docs/benchmarks/swift/throughput.png rename to docs/benchmarks/object-serialization/xlang/swift/throughput.png --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
