The test highlights an issue not covered by micro-
benchmarking: Encoding and Decoding should perform
similar, as factual throughput is determined by
Min(Encoding performance, Decoding performance).
For unknown reasons JDK serialization manages to encode
the message tested like 500_000 times per second,
decoding performance is only 80_000 per second so in
the test the receiver gets dropped quickly:
At 500,000 messages/sec you can burn 6000 cycles per message on a 3Ghz core.Probably he has a problem with malloc during the decoding phase. Every malloc and every free costs between 300 (best case) and several thousand cycles (syscall is required).