Corda uses parkAndSerialize with a custom FiberWriter that takes it serializer from a pool of pre-created serializers - hence it does not use the Kryo serializer that parkAndSerialize() creates for every single call.
Profiling has shown that creating a Kryo serializer has a non-trivial cost in terms of CPU cycles, and as it does not get used in our case, this effort is completely wasted. Therefore, I have created a small patch that allows to parkAndSerialize with a custom writer without creating a new serializer.
Corda uses
parkAndSerialize
with a custom FiberWriter that takes it serializer from a pool of pre-created serializers - hence it does not use the Kryo serializer thatparkAndSerialize()
creates for every single call. Profiling has shown that creating a Kryo serializer has a non-trivial cost in terms of CPU cycles, and as it does not get used in our case, this effort is completely wasted. Therefore, I have created a small patch that allows to parkAndSerialize with a custom writer without creating a new serializer.