-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crdb: better seek, fix untyped versions bug
The untyped versions should not have the terminator byte but we were writing it out. The new code relies on the `suffixTypes` value for a fast path that assumes everything is MVCC. The rest of the cases are handled by a general path that compares suffixes by byte. The performance is slightly better than the old code and we now support all 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.5ns ± 3% 11.2ns ± 0% -1.91% (p=0.001 n=7+7) CockroachDataBlockIterShort/AlphaLen=8,Prefix=8,Shared=4,KeysPerPrefix=4,Logical=10,ValueLen=8/SeekGE-10 119ns ± 2% 116ns ± 0% -2.24% (p=0.000 n=8+8) CockroachDataBlockIterShort/AlphaLen=8,Prefix=8,Shared=4,KeysPerPrefix=4,Logical=10,ValueLen=8/SeekGELatest-10 106ns ± 0% 105ns ± 0% -0.97% (p=0.000 n=7+8) CockroachDataBlockIterShort/AlphaLen=8,Prefix=128,Shared=64,KeysPerPrefix=4,Logical=10,ValueLen=128/Next-10 10.7ns ± 1% 10.6ns ± 0% -1.26% (p=0.000 n=8+8) CockroachDataBlockIterShort/AlphaLen=8,Prefix=128,Shared=64,KeysPerPrefix=4,Logical=10,ValueLen=128/SeekGE-10 93.9ns ± 1% 92.4ns ± 0% -1.56% (p=0.000 n=8+8) CockroachDataBlockIterShort/AlphaLen=8,Prefix=128,Shared=64,KeysPerPrefix=4,Logical=10,ValueLen=128/SeekGELatest-10 85.8ns ± 1% 83.3ns ± 0% -2.96% (p=0.000 n=8+7) ```
- Loading branch information
1 parent
d2480d7
commit efa5401
Showing
4 changed files
with
136 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters