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 387b0054d Update benchmark for rust and update index.md (#327)
387b0054d is described below
commit 387b0054de2f7692c3ca6b54f6902b04bf12a324
Author: Shawn Yang <[email protected]>
AuthorDate: Tue Oct 28 01:05:59 2025 +0800
Update benchmark for rust and update index.md (#327)
---
blog/2025-10-27-fory_0_13_0_release.md | 39 +++++++++++++++++++++++--
docs/docs/introduction/benchmark.md | 14 ++++++++-
public/benchmarks/rust/company.png | Bin 0 -> 44643 bytes
public/benchmarks/rust/ecommerce_data.png | Bin 0 -> 44956 bytes
public/benchmarks/rust/person.png | Bin 0 -> 40224 bytes
public/benchmarks/rust/simple_list.png | Bin 0 -> 39423 bytes
public/benchmarks/rust/simple_map.png | Bin 0 -> 45555 bytes
public/benchmarks/rust/simple_struct.png | Bin 0 -> 43007 bytes
public/benchmarks/rust/system_data.png | Bin 0 -> 41417 bytes
src/constants/index.ts | 47 ++++++++++++++++++++++++++++++
10 files changed, 96 insertions(+), 4 deletions(-)
diff --git a/blog/2025-10-27-fory_0_13_0_release.md
b/blog/2025-10-27-fory_0_13_0_release.md
index bab4a05e8..5a1e1f2ad 100644
--- a/blog/2025-10-27-fory_0_13_0_release.md
+++ b/blog/2025-10-27-fory_0_13_0_release.md
@@ -32,7 +32,7 @@ This is the first Apache Fory Rust release, delivering a
complete, high‑perfor
- Thread-safe and multi-thread capable serialization (context pool)
- Broad collection support (e.g., `VecDeque`, `LinkedList`, `BTreeMap`,
`BTreeSet`, `BinaryHeap`)
-Quick start (minimal example):
+### Quick start (minimal example):
```rust
use fory::{Fory, Error};
@@ -61,6 +61,39 @@ fn main() -> Result<(), Error> {
- Crate: fory on crates.io – https://crates.io/crates/fory
- API docs: docs.rs – https://docs.rs/fory/latest/fory
+### Rust Benchmarks
+
+<img src="/img/benchmarks/rust/ecommerce_data.png" width="90%"/>
+<img src="/img/benchmarks/rust/system_data.png" width="90%"/>
+
+Below are serialize throughput results (TPS; higher is better) comparing Fory
with JSON and Protobuf across multiple datasets and sizes.
+
+| Datatype | Size | Operation | Fory TPS | JSON TPS | Protobuf TPS
| Fastest |
+| -------------- | ------ | --------- | ---------- | ---------- | ------------
| ------- |
+| company | small | serialize | 10,063,906 | 761,673 | 896,620
| fory |
+| company | medium | serialize | 412,507 | 33,835 | 37,590
| fory |
+| company | large | serialize | 9,183 | 793 | 880
| fory |
+| ecommerce_data | small | serialize | 2,350,729 | 206,262 | 256,970
| fory |
+| ecommerce_data | medium | serialize | 59,977 | 4,699 | 5,242
| fory |
+| ecommerce_data | large | serialize | 3,727 | 266 | 295
| fory |
+| person | small | serialize | 13,632,522 | 1,345,189 | 1,475,035
| fory |
+| person | medium | serialize | 3,839,656 | 337,610 | 369,031
| fory |
+| person | large | serialize | 907,853 | 79,631 | 91,408
| fory |
+| simple_list | small | serialize | 27,726,945 | 4,874,957 | 4,643,172
| fory |
+| simple_list | medium | serialize | 4,770,765 | 401,558 | 397,551
| fory |
+| simple_list | large | serialize | 606,061 | 41,061 | 44,565
| fory |
+| simple_map | small | serialize | 22,862,369 | 3,888,025 | 2,695,999
| fory |
+| simple_map | medium | serialize | 2,128,973 | 204,319 | 193,132
| fory |
+| simple_map | large | serialize | 177,847 | 18,419 | 18,668
| fory |
+| simple_struct | small | serialize | 35,729,598 | 10,167,045 | 8,633,342
| fory |
+| simple_struct | medium | serialize | 34,988,279 | 9,737,098 | 6,433,350
| fory |
+| simple_struct | large | serialize | 31,801,558 | 4,545,041 | 7,420,049
| fory |
+| system_data | small | serialize | 5,382,131 | 468,033 | 569,930
| fory |
+| system_data | medium | serialize | 174,240 | 11,896 | 14,753
| fory |
+| system_data | large | serialize | 10,671 | 876 | 1,040
| fory |
+
+Note: Results depend on hardware, dataset, and implementation versions. See
the Rust guide for how to run benchmarks yourself:
https://github.com/apache/fory/blob/main/rust/benches/README.md
+
## Python: Drop‑in Replacement for pickle
`pyfory` now acts as a high‑performance drop‑in replacement for
`pickle`/`cloudpickle`, while keeping the same simple API and adding security
and performance features.
@@ -107,7 +140,7 @@ Read more: Python Guide –
https://fory.apache.org/docs/latest/python_serializa
- feat(Rust): support Option in MetaFieldType se/de by @urlyy in
https://github.com/apache/fory/pull/2528
- feat(rust): support skipping fields bytes when deserializing in compatible
mode by @urlyy in https://github.com/apache/fory/pull/2545
- feat(go): add type meta encoding for meta share by @junjiexh in
https://github.com/apache/fory/pull/2554
-- feat(Rust): Support automatic conversion between T and Option<T> when
deserialize by @urlyy in https://github.com/apache/fory/pull/2563
+- feat(Rust): Support automatic conversion between T and `Option<T>` when
deserialize by @urlyy in https://github.com/apache/fory/pull/2563
- feat(java): bean encoder implemented interfaces honor `@Ignore` by
@stevenschlansker in https://github.com/apache/fory/pull/2576
- refactor(java): refactor fory java exception hierarchical structure by
@chaokunyang in https://github.com/apache/fory/pull/2577
- feat(Go): Implement ahead of time codegen for fory-go serialization by
@ThisingL in https://github.com/apache/fory/pull/2553
@@ -151,7 +184,7 @@ Read more: Python Guide –
https://fory.apache.org/docs/latest/python_serializa
- refactor(Rust): Refine api name by @urlyy in
https://github.com/apache/fory/pull/2671
- feat(rust): support rust dyn trait object serialization by @chaokunyang in
https://github.com/apache/fory/pull/2691
- feat(rust): support dyn any trait object serialization for box/arc/rc by
@chaokunyang in https://github.com/apache/fory/pull/2704
-- feat(rust): support shared reference tracking for arc/rc<dny T> by
@chaokunyang in https://github.com/apache/fory/pull/2707
+- feat(rust): support shared reference tracking for `arc/rc<dyn T>` by
@chaokunyang in https://github.com/apache/fory/pull/2707
- feat(rust): avoid downcast method of multiple trait objects in same module
conflict by @chaokunyang in https://github.com/apache/fory/pull/2708
- feat(rust): add deref to arc/rc wrapper by @chaokunyang in
https://github.com/apache/fory/pull/2709
- refactor(rust): unify rc/arc wrapper macro arms into one function by
@chaokunyang in https://github.com/apache/fory/pull/2711
diff --git a/docs/docs/introduction/benchmark.md
b/docs/docs/introduction/benchmark.md
index ba00a0fd0..192dfa9cc 100644
--- a/docs/docs/introduction/benchmark.md
+++ b/docs/docs/introduction/benchmark.md
@@ -12,6 +12,8 @@ Dynamic serialization frameworks supports polymorphism and
reference, which has
to static serialization frameworks, unless it uses the jit techniques as
Apache Fory™ did.
Since Apache Fory™ will generate code at runtime, please warm up before
collecting benchmark statistics.
+## Java Benchmark
+
### Java Serialization
<img width="33%" alt=""
src="/img/benchmarks/serialization/bench_serialize_compatible_STRUCT_to_directBuffer_tps.png"
/>
@@ -28,7 +30,17 @@ Since Apache Fory™ will generate code at runtime, please
warm up before collec
See [benchmarks](https://github.com/apache/fory/tree/main/docs/benchmarks) for
more benchmarks about type forward/backward compatibility, off-heap support,
zero-copy serialization.
-### JavaScript
+## Rust Benchmark
+
+<img src="/img/benchmarks/rust/company.png" width="90%"/>
+
+<img src="/img/benchmarks/rust/ecommerce_data.png" width="90%"/>
+
+<img src="/img/benchmarks/rust/system_data.png" width="90%"/>
+
+Note: Results depend on hardware, dataset, and implementation versions. See
the Rust guide for how to run benchmarks yourself:
https://github.com/apache/fory/blob/main/rust/benches/README.md
+
+## JavaScript Benchmark
<img width="33%" alt="" src="/img/benchmarks/javascript/complex_object.jpg" />
diff --git a/public/benchmarks/rust/company.png
b/public/benchmarks/rust/company.png
new file mode 100644
index 000000000..eee9de23f
Binary files /dev/null and b/public/benchmarks/rust/company.png differ
diff --git a/public/benchmarks/rust/ecommerce_data.png
b/public/benchmarks/rust/ecommerce_data.png
new file mode 100644
index 000000000..11a507329
Binary files /dev/null and b/public/benchmarks/rust/ecommerce_data.png differ
diff --git a/public/benchmarks/rust/person.png
b/public/benchmarks/rust/person.png
new file mode 100644
index 000000000..d31e0d030
Binary files /dev/null and b/public/benchmarks/rust/person.png differ
diff --git a/public/benchmarks/rust/simple_list.png
b/public/benchmarks/rust/simple_list.png
new file mode 100644
index 000000000..00c5b7d4e
Binary files /dev/null and b/public/benchmarks/rust/simple_list.png differ
diff --git a/public/benchmarks/rust/simple_map.png
b/public/benchmarks/rust/simple_map.png
new file mode 100644
index 000000000..1142bb3fb
Binary files /dev/null and b/public/benchmarks/rust/simple_map.png differ
diff --git a/public/benchmarks/rust/simple_struct.png
b/public/benchmarks/rust/simple_struct.png
new file mode 100644
index 000000000..973fa35e8
Binary files /dev/null and b/public/benchmarks/rust/simple_struct.png differ
diff --git a/public/benchmarks/rust/system_data.png
b/public/benchmarks/rust/system_data.png
new file mode 100644
index 000000000..330aa6b52
Binary files /dev/null and b/public/benchmarks/rust/system_data.png differ
diff --git a/src/constants/index.ts b/src/constants/index.ts
index 77b20b3bc..4c8ee93d4 100644
--- a/src/constants/index.ts
+++ b/src/constants/index.ts
@@ -76,6 +76,53 @@ object ScalaExample {
}`,
},
+ rust: {
+ label: "Rust",
+ code: `use fory::{Fory, Error};
+use fory::ForyObject;
+
+#[derive(ForyObject, Debug, PartialEq)]
+struct User {
+ name: String,
+ age: i32,
+ email: String,
+}
+
+fn main() -> Result<(), Error> {
+ let mut fory = Fory::default();
+ fory.register::<User>(1)?;
+
+ let user = User { name: "Alice".into(), age: 30, email:
"[email protected]".into() };
+ let bytes = fory.serialize(&user)?;
+ let decoded: User = fory.deserialize(&bytes)?;
+ assert_eq!(user, decoded);
+ Ok(())
+}`,
+
+ },
+
+ python: {
+ label: "Python",
+ code: `import pyfory
+from dataclasses import dataclass
+from typing import List, Dict
+
+@dataclass
+class Person:
+ name: str
+ age: int
+ scores: List[int]
+ metadata: Dict[str, str]
+
+# Python mode - supports all Python types including dataclasses
+fory = pyfory.Fory(xlang=False, ref=True)
+fory.register(Person)
+person = Person("Bob", 25, [88, 92, 85], {"team": "engineering"})
+data = fory.serialize(person)
+result = fory.deserialize(data)
+print(result) # Person(name='Bob', age=25, ...)`,
+ },
+
};
export const imageUrls = [
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]