Unnecessary instantiation of `clazz` if `includeManifest` is disabled in `KryoSerializerBackend`
hveiga opened this issue ยท 4 comments
Hello,
I am debugging an issue with Kryo deserialization using Artery and includeManifest
is set to false. When deserializing any object I can find that manifest
is ""
and therefore clazz
always becomes a Failure(ClassNotFoundException(""))
since it cannot find a proper class for the value ""
. Since our system is network-heavy, we are seeing this consuming more CPU than expected (throwing exception is usually expensive and should be avoided if possible):
The actual issue seems to be here:
I am happy to open a PR to solve the issue once I get confirmation this should be changed.
Hi @hveiga
You're absolutely right - clazz should be initialized only within the if clause! Good catch.
Would be nice if you could supply a PR. Thx!
I'll do it shortly, thanks for the confirmation!
Thanks for responding and merging so quick, greatly appreciated. Could we get this change released on 2.5.1 some time soon?
Thx for finding the issue - this benefits everybody...
I guess we'll create a bugfix for this one right away - should be in maven central by tomorrow...