Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
colblk: check first timestamp before binary search
This commit improves the code in the cockroach key seeker to first check the latest timestamp (which will be the one we're looking for in a majority of cases). ``` name old time/op new time/op delta CockroachDataBlockIterShort/AlphaLen=8,Prefix=8,Shared=4,KeysPerPrefix=4,Logical=10,ValueLen=8/Next-10 11.4ns ± 4% 11.2ns ± 1% ~ (p=0.308 n=8+8) CockroachDataBlockIterShort/AlphaLen=8,Prefix=8,Shared=4,KeysPerPrefix=4,Logical=10,ValueLen=8/SeekGE-10 118ns ± 0% 118ns ± 0% +0.24% (p=0.023 n=8+8) CockroachDataBlockIterShort/AlphaLen=8,Prefix=8,Shared=4,KeysPerPrefix=4,Logical=10,ValueLen=8/SeekGELatest-10 109ns ± 0% 108ns ± 6% -1.29% (p=0.019 n=8+7) CockroachDataBlockIterShort/AlphaLen=8,Prefix=128,Shared=64,KeysPerPrefix=4,Logical=10,ValueLen=128/Next-10 10.6ns ± 0% 10.6ns ± 0% -0.64% (p=0.000 n=7+8) CockroachDataBlockIterShort/AlphaLen=8,Prefix=128,Shared=64,KeysPerPrefix=4,Logical=10,ValueLen=128/SeekGE-10 95.0ns ± 0% 92.2ns ± 0% -2.94% (p=0.000 n=8+8) CockroachDataBlockIterShort/AlphaLen=8,Prefix=128,Shared=64,KeysPerPrefix=4,Logical=10,ValueLen=128/SeekGELatest-10 88.2ns ± 0% 83.6ns ± 0% -5.23% (p=0.000 n=8+7) ````
- Loading branch information