toValue and fromValue methods in DefaultMessagePackMapper are hot spots as they are called on each request. This code was first written using Java streams, but while it allowed to make the code more readable, the streams are not very well-suitable for this task. The Java streams work better when we can execute the chained lambda functions in parallel on an executor, but are worse when replacing the normal for loops - they add significant overhead because of a lot of created auxiliary classes and objects in runtime.
Now as the DefaultMessagePackMapper code is stable we can replace the stream-based code with more optimized loop-based code.
toValue
andfromValue
methods in DefaultMessagePackMapper are hot spots as they are called on each request. This code was first written using Java streams, but while it allowed to make the code more readable, the streams are not very well-suitable for this task. The Java streams work better when we can execute the chained lambda functions in parallel on an executor, but are worse when replacing the normalfor
loops - they add significant overhead because of a lot of created auxiliary classes and objects in runtime.Now as the DefaultMessagePackMapper code is stable we can replace the stream-based code with more optimized loop-based code.