Skip to content

[FLINK-37722] Eliminate redundant field initialization of PojoSerializer #26513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

X-czh
Copy link
Contributor

@X-czh X-czh commented Apr 27, 2025

What is the purpose of the change

Perf: eliminate redundant field initialization of PojoSerializer.

Brief change log

Currently, PojoSerializer will first create a new POJO instance and initialize all the fields (in the createInstance() method), then deserialize and set fields. The field initialization with in the createInstance() method is redundant, as all fields will be set later during deserialization anyway. We should eliminate it for better performance.

The TupleSerializer has already applied similar techique, see the usage of TupleSerializer#instantiateRaw.

Verifying this change

This change is already covered by existing tests.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

@flinkbot
Copy link
Collaborator

flinkbot commented Apr 27, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@X-czh
Copy link
Contributor Author

X-czh commented Apr 27, 2025

@flinkbot run azure

@X-czh
Copy link
Contributor Author

X-czh commented Apr 28, 2025

@JunRuiLee Could you help take a review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants