Skip to content
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

What does registerClass do? #348

Open
debraj-manna opened this issue Feb 8, 2024 · 0 comments
Open

What does registerClass do? #348

debraj-manna opened this issue Feb 8, 2024 · 0 comments

Comments

@debraj-manna
Copy link

Hi

The javadoc of registerClass states like below

 /**
     *
     * Preregister a class (use at init time). This avoids having to write class names.
     * Its a very simple and effective optimization (frequently > 2 times faster for small objects).
     *
     * Read and write side need to have classes preregistered in the exact same order.
     *
     * The list does not have to be complete. Just add your most frequently serialized classes here
     * to get significant gains in speed and smaller serialized representation size.
     *
     */

Let's say on the write side A.class is registered. How is deserialization going to behave in the below cases

  1. On the read side A.class is not registered and instead some other class, B.class is registered. Will the read side break in this case during deserialization?
  2. On the read side no class is registered. Will read side work?
  3. On the read side FST is not used and JDK serialization is used. Will the read side break in this case?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant