Zhanghao Chen created FLINK-37680: ------------------------------------- Summary: Add subclass cache for PojoSerializer Key: FLINK-37680 URL: https://issues.apache.org/jira/browse/FLINK-37680 Project: Flink Issue Type: Sub-task Components: API / Type Serialization System Reporter: Zhanghao Chen Attachments: image-2025-04-15-16-31-55-289.png, image-2025-04-15-16-33-11-325.png
When the value to deserialize is an untagged subclass of the declared POJO type, Flink loads its acutal class every time using {{{}Class.forName{}}}, which is inefficient. We can cache the subclasses to speed up. We tested on a production job, and the result is promising: * Flame graph before the optim (Class.forName highlighted in green): !image-2025-04-15-16-31-55-289.png|width=457,height=150! * Flame graph after the optim (Subclass cache access highlighted in green): !image-2025-04-15-16-33-11-325.png|width=460,height=156! -- This message was sent by Atlassian Jira (v8.20.10#820010)