-
Notifications
You must be signed in to change notification settings - Fork 829
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
Kryo is reset twice when used in a pool #754
Comments
For option 1 (Do not let Kryo implement Poolable) I'd say things would work as expected. |
There is only one potential issue: If I don't have a strong opinion on this. I'm OK with either option. |
Erm, right 😉 I'd think that users turning off So I'd prefer option 1. |
Agreed 😉 I'll create a PR tomorrow morning. |
👍 Awesome! |
…is not called twice after each (de)serialization
…is not called twice after each (de)serialization
Kryo 5 has a
Poolable
interface for objects that can be used withPool
.When such an object is returned to the pool,
Poolable.reset()
is called:This makes using
Input
undOutput
much easier in combination with pools.The problem is that the
Kryo
class implementsPoolable
as well. So ifautoReset
is enabled (the default),Kryo.reset()
will be called twice. First by auto-reset at the end of serialization, then when the object is returned to the pool.This operation is potentially expensive, especially when references are enabled and class registration is not required.
We have two options to fix this:
Kryo
implementPoolable
autoReset
should be disabled when Kryo is used in a pool@magro: What do you think? We should address this before releasing 5.0 Final.
The text was updated successfully, but these errors were encountered: