JAVA-5789 Implements batch ByteBuf::indexOf
Similarly to #1629 this have some large performance impact to existing users 🙏
Hi @franz1981,
As replied on the associated ticket JAVA-5789, thank you again for your contribution and for taking the time to explore performance improvements.
I really liked your suggestion and the direction it suggested. However, we ended up implementing an alternative SWAR-based solution as part of JAVA-5842. This approach resulted in approximately ~10% better performance according to our benchmarks. For reference, our benchmarks are based on the framework described in the benchmarking specification and implemented in the driver-benchmarks module.
Given this, I’ll go ahead and close this PR as superseded by the implementation in JAVA-5842.
Hi @vbabanin
I've taken a quick look at the SWAR approach you used there and it is sounds - but for the Netty use case I still suggest to leverage what is offered by ByteBuf::indexOf since within Netty I could have used bound and accessibility check free (and without position change too!) getLong - which directly become as simple as a "mov" in x86. In term of absolute performance increase, IDK if the original benchmark exercise branch misses and if the new SWAR implementation is as effective as the one I mentioned in Netty - which, accordingly to my past measurements, deliver a good 30% boost alone in Http 1.1 decoding (it is used for both line and headed name/values parsing).
Said that, many thanks for the consideration and keep the good work ❤️