Skip to content

perf: optimize serialization perf#3656

Merged
chaokunyang merged 48 commits intoapache:mainfrom
chaokunyang:optimize_serialization_perf
May 8, 2026
Merged

perf: optimize serialization perf#3656
chaokunyang merged 48 commits intoapache:mainfrom
chaokunyang:optimize_serialization_perf

Conversation

@chaokunyang
Copy link
Copy Markdown
Collaborator

@chaokunyang chaokunyang commented May 7, 2026

Why?

Improve serialization/deserialization throughput across Fory runtimes and keep the cross-language benchmark suite current, comparable, and documented.

What does this PR do?

  • Optimizes hot serialization/deserialization paths in JavaScript/TypeScript, Go, C++, C#, Python, and Rust, including ref reset skips, root serializer/deserializer caches, TypeMeta/read-schema caches, string and varint fast paths, small typed-array writes, Go varint32 struct reads, C++ root struct type info caching, C# inline TypeMeta indexes, Python declared ndarray fields, and Rust signed varint encoding.
  • Adds Java xlang JMH benchmarks with FlatBuffers coverage, generated FlatBuffers sources, a benchmark runner, and a report renderer.
  • Refreshes benchmark payloads by renaming the simple struct fixture to NumericStruct, expanding it to 12 int32 fields, and aligning protobuf/msgpack/json benchmark coverage across languages.
  • Updates benchmark runners and report generators for C++, C#, Dart, Go, Java, JavaScript, Python, Rust, and Swift, including combined throughput plots, serialized-size output, and regenerated docs/benchmarks/** artifacts.
  • Adds/updates focused coverage for the changed paths, including JavaScript TypeMeta-compatible reader tests and Dart generated benchmark model round-trip tests.

Related issues

#1017

AI Contribution Checklist

  • Substantial AI assistance was used in this PR: yes / no
  • If yes, I included a completed AI Contribution Checklist in this PR description and the required AI Usage Disclosure.
  • If yes, my PR description includes the required ai_review summary and screenshot evidence of the final clean AI review results from both fresh reviewers on the current PR diff or current HEAD after the latest code changes.

Does this PR introduce any user-facing change?

  • Does this PR introduce any public API change?
  • Does this PR introduce any binary protocol compatibility change?

Benchmark

  • Refreshes benchmark reports and images under docs/benchmarks/** for C++, C#, Dart, Go, Java, JavaScript, Python, Rust, and Swift.
  • Adds Java xlang throughput reporting; the generated Java report documents JMH parameters: -f 1 -wi 3 -i 3 -t 1 -w 3s -r 3s -bm thrpt -tu s.

@chaokunyang chaokunyang merged commit 7f8e223 into apache:main May 8, 2026
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants