See discussion in
HBASE-9935. Currently KeyValue caches the keyLength in order to avoid decoding the key length in getKeyLength() repeatedly.
Benchmarking outside of a profiler revealed no improvement from that cache (and a sampling profiler also does not indicate getKeyLength() as a performance issue).
Along with this there's also a slight fix in ScanQueryMatcher.