capnproto / capnproto-java

Cap'n Proto in pure Java
Other
397 stars 85 forks source link

Performance-related microcleanup #127

Closed mdindoffer closed 2 years ago

mdindoffer commented 2 years ago

Perform small cleanups and optimizations that positively impact performance.

dwrensha commented 2 years ago

Thanks! How much of a speedup are you seeing with these changes?

mdindoffer commented 2 years ago

Nothing huge, these are really minor changes.

In synthetic benchmarks of deserialization I gain consistently about 7% - 10% improvement in throughput on JDK17. https://gist.github.com/mdindoffer/dd0bb4661a181127939e75846c4fe3a4

Before

Benchmark                            Mode  Cnt         Score        Error  Units
MyBenchmark.benchmarkSerializeRead  thrpt   50  15686722.743 ± 973023.487  ops/s

After

Benchmark                            Mode  Cnt         Score        Error  Units
MyBenchmark.benchmarkSerializeRead  thrpt   50  17242835.294 ± 148983.346  ops/s