Skip to content

Avoid transient ByteBufferView

Lukasa requested to merge lukasa/RediStack:cb-avoid-temporary-bbv-master into master

Motivation:

When attempting to locate a single byte, creating a transient ByteBufferView is an excessively heavyweight operation compared to a simple getInteger. In particular, a BBV requires retain/release operations to enforce the CoW invariants, as well as requires jumps through substantial amounts of generic Collection code. While this can be specialized, so can getInteger, and getInteger has much less code in the way to cause costs.

Modifications:

  • Replace temporary view creation with getInteger.

Results:

5% performance improvement on raw throughput tests.

Merge request reports