Code Generation in Serializers and Comparators of Apache Flink
There is a shift in the Big Data world. Applications used to be I/O bound. InfiniBand, SSDs reduced the I/O overhead and more sophisticated algorithms were developed. CPU became a bottleneck for some applications. Using state of the art CPUs, reduced CPU usage can lead to reduced electricity costs even when an application is I/O bound.
Apache Flink is an open source framework for processing streams of data and batch jobs. It is using serialization for wide variety of purposes. Not only for sending data over the network, saving it to the hard disk, or for fault tolerance, but also some of the operators can work on the serialized representation of the data instead of Java objects. This approach can improve the performance significantly. Flink has a custom serialization method that enables operators to work on the serialized formats.
Currently, Apache Flink uses reflection to serialize Plain Old Java Objects (POJOs). Reflection in Java is notoriously slow. Moreover, the structure of the code is harder to optimize for the JIT compiler. As a Google Summer of Code project in 2016 we implemented code generation for serializers and comparators for POJOs to improve the performance of Apache Flink. Flink has a delicate type system which provides us with lots of information about the types that need to be serialized. Using this information it is possible to generate specialized code with great performance.
We achieved more than 6X performance improvement in the serialization which was about 20% performance improvement in the overall Flink jobs.
preprint (a4-horvath.pdf) | 464KiB |
Slides (ICOOOLPS2017.pdf) | 4.36MiB |
Mon 19 JunDisplayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change
14:00 - 15:30 | |||
14:00 60mTalk | Can Compiler Magic Ever Be Explained? ICOOOLPS | ||
15:00 30mTalk | Code Generation in Serializers and Comparators of Apache Flink ICOOOLPS Gábor Horváth Eötvös Loránd University, Faculty of Informatics, Department of Programming Languages and Compilers, Norbert Pataki Eötvös Loránd University, Faculty of Informatics, Department of Programming Languages and Compilers, Márton Balassi Hungarian Academy of Sciences Link to publication DOI File Attached |