一句话:提出 HeapBuffers,让 Java 托管内存直接采用 IO 就绪的稠密二进制布局,从而消除序列化/反序列化开销。
云应用中数据的序列化与反序列化(DSD)代价高昂,Java 等托管语言尤甚,因为其托管内存采用稀疏、平台相关、与 IO 不兼容的对象布局,每次 IO 都需转换。论文提出 Java 库 HeapBuffers:它保留 Java 友好的托管内存编程模型,但底层数据以稠密、平台无关的内存格式存储,因此可直接对数据执行 IO,无需在 VM 内部表示与外部格式之间来回转换,从根本上省去 DSD。为保证性能,作者结合编译器优化与专用垃圾回收,使访问 HeapBuffers 数据的开销接近普通 Java 对象。实验表明,HeapBuffers 数据可高效访问并可直接用于 IO,DSD 成本实际可忽略,使用 HeapBuffers 的应用其 IO 性能常常比主流 DSD 库快数个数量级。
In modern cloud applications, data serialization and deserialization (DSD) are common yet expensive operations. Languages such as Java incur significant overhead from DSD operations because of their managed memory, which uses an IO-incompatible, sparse, platform-dependent data layout for storing objects. Can language VMs bypass costly DSD operations by directly operating on an IO-ready binary format? In this paper, we address this question by presenting a new DSD library for Java called HeapBuffers. HeapBuffers maintains a Java-friendly programming model through managed memory, yet it operates on data stored using a dense, platform-independent, memory format. In this way, HeapBuffers data can be used to perform IO operations without the need to convert objects from/to a VM-internal memory representation, thus eliminating the need for expensive DSD operations. Compiler optimizations combined with specialized garbage collection ensure that accessing HeapBuffers data is nearly as efficient as handling regular Java objects. The answer to our question is largely positive: our experiments show that HeapBuffers data can be accessed at high performance and can be used as is to perform IO, making the cost of DSD effectively negligible. IO performance of applications using HeapBuffers is often orders of magnitude faster than that obtained using the prevailing DSD libraries.
@article{paperbot2956,
title = {HeapBuffers: Why Not Just Using a Binary Serialization Format for Your Managed Memory?},
author = {Daniele Bonetta and Júnior Löff and Matteo Basso and Walter Binder},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {OOPSLA2},
year = {2025},
doi = {10.1145/3763175}
}