puniverse / quasar

Fibers, Channels and Actors for the JVM
http://docs.paralleluniverse.co/quasar/
Other
4.56k stars 575 forks source link

Custom park and serialize without creating a new serializer #314

Closed blsemo closed 5 years ago

blsemo commented 5 years ago

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.