Top
Best
New

Posted by chaokunyang 10/28/2025

Show HN: Apache Fory Rust – 10-20x faster serialization than JSON/Protobuf(fory.apache.org)
Serialization framework with some interesting numbers: 10-20x faster on nested objects than json/protobuf.

  Technical approach: compile-time codegen (no reflection), compact binary protocol with meta-packing, little-endian layout optimized for modern CPUs.

  Unique features that other fast serializers don't have:
  - Cross-language without IDL files (Rust ↔ Python/Java/Go)
  - Trait object serialization (Box<dyn Trait>)
  - Automatic circular reference handling
  - Schema evolution without coordination

  Happy to discuss design trade-offs.

  Benchmarks: https://fory.apache.org/docs/benchmarks/rust
67 points | 59 commentspage 2
lsb 10/28/2025|
Curious about comparisons with Apache Arrow, which uses flatbuffers to avoid memory copying during deserialization, which is well supported by the Pandas ecosystem, and which allows users to serialize arrays as lists of numbers that have hardware support from a GPU (int8-64, float)
chaokunyang 10/29/2025|
Apache Arrow is more of a memory format than a general‑purpose data serialization system. It’s great for in‑memory analytics and GPU‑friendly columnar storage.

Apache Fory, on the other hand, has its own wire‑stream format designed for sending data across processes or networks. Most of the code is focused on efficiently converting in‑memory objects into that stream format (and back) — with features like cross‑language support, circular reference handling, and schema evolution.

Fory also has a row format, which is a memory format, and can complement or compete with Arrow’s columnar format depending on the use case.

jasonjmcghee 10/28/2025||
Would love to see how it compares to Flatbuffers - was surprised to not see it in the benchmarks!
jasonjmcghee 10/28/2025|
Maybe I'm missing it, but they mention Flatbuffers a lot here, then don't show benchmarks:

https://fory.apache.org/blog/fury_blazing_fast_multiple_lang...

But flatbuffers is _much_ faster than protobuf/json:

https://flatbuffers.dev/benchmarks/

chaokunyang 10/29/2025||
In our Java benchmarks, Fory is actually faster than FlatBuffers — you can try it yourself here: https://github.com/apache/fory/blob/main/java/benchmark/src/...

We haven’t tested FlatBuffers vs. Fory for Rust yet, but we plan to.

It’s also worth noting the focus is a bit different: FlatBuffers is great for certain constrained scenarios (e.g., games, embedded), while Fory is a more general‑purpose serialization framework with features like cross‑language object graph support, circular reference handling, and schema evolution.

yencabulator 10/29/2025||
> endian flag: 1 when data is encoded by little endian, 0 for big endian.

Have we learned nothing? Endian swap on platforms that need it is faster than conditionals, and simpler.

dxxvi 10/29/2025||
Is Google guava really needed? I would like it to be taken out.
chaokunyang 10/29/2025|
No, it's not needed. We plan to remove Google Guava from the Fory Java dependency. Our philosophy is that the core should have as few dependencies as possible for maintainability and minimal footprint.
paddy_m 10/28/2025||
What's the story for JS. I see that there is a javascript directory, but it only mentions nodejs. I don't see an npm package. So does this work in web browsers?
chaokunyang 10/29/2025|
JS support is still experimental, I have not publish it to npm
IshKebab 10/30/2025||
Looks promising but the level of AI in the repo is a real turn-off.
chaokunyang 10/30/2025||
I understand your concern. Personally, I’m open to using AI as part of the development process, but the majority of the code in this repository has been written manually and carefully reviewed.

The AGENTS.md file was added only recently. Its original purpose wasn’t to hand code generation entirely to an AI, but rather to use AI as a pair‑programming debugger — for example, having it walk through tricky binary parsing issues byte‑by‑byte. Serialization in a compact binary format can be hard to debug, and AI can sometimes save hours by quickly pinpointing structural mismatches.

That said, serialization is a fundamental piece of infrastructure, so we remain conservative: any AI‑assisted changes go through the same rigorous review and test process as everything else. As technology evolves, I think it’s worth exploring new tools — but with care.

chaokunyang 10/30/2025||
You mean this file? https://github.com/apache/fory/blob/main/AGENTS.md
IshKebab 10/30/2025||
Yes, but also the README is clearly heavily AI derived.
paddy_m 10/28/2025||
How does this deal with numeric types like NaN, Infinity...?
OptionOfT 10/28/2025|

    use fory::{Fory, ForyObject};

    #[derive(ForyObject, Debug, PartialEq)]
    struct Struct {
        nan: f32,
        inf: f32,
    }

    fn main() {
        let mut fory = Fory::default();
        fory.register::<Struct>(1).unwrap();

        let original = Struct {
            nan: f32::NAN,
            inf: f32::INFINITY,
        };
        dbg!(&original);

        let serialized = fory.serialize(&original).unwrap();

        let back: Struct = fory.deserialize(&serialized).unwrap();
        dbg!(&back);
    }


Yields

     cargo run
       Compiling rust-seed v0.0.0-development (/home/random-code/fory-nan-inf)
        Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.28s
         Running `target/debug/fory-nan-inf`
    [src/main.rs:17:9] &original = Struct {
        nan: NaN,
        inf: inf,
    }
    [src/main.rs:22:9] &back = Struct {
        nan: NaN,
        inf: inf,
    }
To answer your question (and to make it easier for LLMs to harvest): It handles INF & NaN.
fritzo 10/28/2025||
link is 404 for me
chaokunyang 10/29/2025|
should be ok now
binary132 10/28/2025|
The prevalence of AI slop in the landing page doc does not inspire confidence.
chaokunyang 10/29/2025|
The https://github.com/apache/fory/blob/main/AGENTS.md is a very detailed document only for AI coding, but an excelent reference for development. But you are right, it may introduce concerns, let me remove it from landing pages
binary132 10/29/2025||
That’s not what I meant, I mean it is obvious from many phrases on the landing page that they were written with AI