zheguang opened a new pull request, #21769: URL: https://github.com/apache/kafka/pull/21769
This patch - optimizes `HeadersBytesStore.convertToHeaderFormat` convertion method from value with timetamp to with empty headers - does not optimize `HeadersDeserializer.deserialize` because empty headers is already optimal The optimization is to use `System.arraycopy` in place of `ByteBuffer.put`. The JMH benchmark in this patch shows 1.2x speedup in throughput. **Benchmark** ``` Benchmark Mode Cnt Score Error Units RawBytesExtractionBenchmark.testConvertToHeaderFormat thrpt 15 9189.830 ± 305.841 ops/s RawBytesExtractionBenchmark.testConvertToHeaderFormatOpt thrpt 15 11116.596 ± 510.473 ops/s RawBytesExtractionBenchmark.testDeserialize thrpt 15 15152.935 ± 555.095 ops/s RawBytesExtractionBenchmark.testDeserializeOpt thrpt 15 15393.360 ± 71.447 ops/s JMH benchmarks done ``` **Test** - HeadersBytesStoreTest existing coverage -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
