一句话:提出 JOSer,通过运行时生成类特定序列化代码并借助 JVM JIT 持续优化,显著提升 Java 重负载序列化吞吐。
现代 Java 系统常依赖手工定义对象模式或全能通用序列化器,导致其在重度序列化负载下不灵活且低效。论文揭示了一种序列化专用的优化机会,并据此提出 JOSer:一种即时(JIT)对象序列化技术。JOSer 在运行时为每个类生成 JIT 友好的序列化器代码,再利用 JVM 的 JIT 编译器持续优化这些代码,并共享对象元数据与正在优化的序列化器。评估将 JOSer 与包括 OpenJDK 内置序列化在内的六种 Java 序列化技术对比,序列化吞吐最高提升 20~83×,反序列化最高提升 43~229×。JOSer 已部署于真实产品,使 Flink 序列化 CPU 使用降低 35.32~41.14%,搜索推荐延迟降低 30+ ms,并支撑开源序列化框架 Apache Fory。
Object serialization is critical in Java, which preserves objects in memory and transfers them among software systems if needed. However, the serialization techniques of modern Java systems are usually inflexible and inefficient under heavy serialization workloads, as they rely on manually-defined object schemas or omni-functional serializers. To tackle the above problem, we reveal a novel, serialization-specific optimization opportunity in Java. Based on it, we develop JOSer (Just-in-time Object SERializer), an efficient, Just-in-Time (JIT) object serialization technique. At runtime, JOSer generates a set of class-specific, JIT-friendly object serializers (i.e., serialization code), and then continuously optimizes them with the JIT compiler of Java Virtual Machine (JVM). JOSer also shares the metadata of objects under serialization and the serializers under optimization. We evaluate JOSer against six Java serialization techniques including OpenJDK's built-in serialization technique. Overall, JOSer improves the throughput by up to 20~83× in serialization and 43~229× in deserialization. JOSer has been successfully deployed in real-world products, reducing serialization CPU usage of Flink by 35.32~41.14% and latency of search recommendations by 30+ ms. JOSer grounds Apache Fory#8482;, an open-source serialization framework available at https://fory.apache.org/.
@inproceedings{YangNLWY00026,
title = {JOSer: Just-In-Time Object Serialization for Heavy Java Serialization Workloads},
author = {Chaokun Yang and Pengbo Nie and Ziyi Lin and Weipeng Wang and Qianwei Yu and Chengcheng Wan and He Jiang and Yuting Chen},
booktitle = {ASPLOS},
year = {2026},
doi = {10.1145/3779212.3790179}
}