forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage/engine: optimize MVCCFindSplitKey
Use an explicit iterator instead of Reader.Iterate() in order to reduce allocations. Specifically, we can avoid 2 allocations per key/value. Do not create a snapshot when calling MVCCFindSplitKey as internally it uses a single iterator which has an implicit snapshot. Remove the unused rangeID parameter to MVCCFindSplitKey. This parameter was only being used to lookup the range stats to log them under V(2). name old time/op new time/op delta MVCCFindSplitKey_RocksDB/valueSize=32-8 341ms ±23% 269ms ± 8% -21.29% (p=0.000 n=10+10) name old speed new speed delta MVCCFindSplitKey_RocksDB/valueSize=32-8 198MB/s ±19% 250MB/s ± 8% +26.34% (p=0.000 n=10+10) name old alloc/op new alloc/op delta MVCCFindSplitKey_RocksDB/valueSize=32-8 36.6MB ± 0% 0.0MB ± 0% -100.00% (p=0.000 n=9+10) name old allocs/op new allocs/op delta MVCCFindSplitKey_RocksDB/valueSize=32-8 1.16M ± 0% 0.00M ± 0% -100.00% (p=0.000 n=9+10) See cockroachdb#18646
- Loading branch information
1 parent
cc2d642
commit 4da09e7
Showing
5 changed files
with
124 additions
and
105 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
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