Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
86512: kvserver/rangefeed: use `RangeKeyChanged()` in catchup scans r=tbg a=erikgrinaker This avoids a key comparison in the hot path. However, we do not have any benchmarks that emit range keys (they are always filtered out by the `MVCCIncrementalIterator`), so it doesn't show up here: ``` name old time/op new time/op delta CatchUpScan/mixed-case/withDiff=true/perc=0.00/numRangeKeys=0-24 525ms ± 1% 520ms ± 1% ~ (p=0.056 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=0.00/numRangeKeys=1-24 570ms ± 0% 559ms ± 0% -1.98% (p=0.008 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=0.00/numRangeKeys=100-24 624ms ± 1% 618ms ± 0% -0.96% (p=0.008 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=50.00/numRangeKeys=0-24 1.03s ± 0% 1.02s ± 0% -0.56% (p=0.016 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=50.00/numRangeKeys=1-24 1.21s ± 0% 1.21s ± 0% ~ (p=0.056 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=50.00/numRangeKeys=100-24 1.71s ± 0% 1.70s ± 1% ~ (p=0.056 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=75.00/numRangeKeys=0-24 898ms ± 0% 906ms ± 0% +0.86% (p=0.008 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=75.00/numRangeKeys=1-24 1.08s ± 1% 1.07s ± 1% ~ (p=0.421 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=75.00/numRangeKeys=100-24 1.44s ± 0% 1.44s ± 0% ~ (p=0.841 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=95.00/numRangeKeys=0-24 190ms ± 1% 189ms ± 1% ~ (p=0.056 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=95.00/numRangeKeys=1-24 215ms ± 0% 215ms ± 1% ~ (p=0.421 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=95.00/numRangeKeys=100-24 325ms ± 1% 324ms ± 1% ~ (p=0.548 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=99.00/numRangeKeys=0-24 158ms ± 1% 158ms ± 1% ~ (p=0.690 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=99.00/numRangeKeys=1-24 181ms ± 0% 182ms ± 0% +0.73% (p=0.008 n=5+5) CatchUpScan/mixed-case/withDiff=true/perc=99.00/numRangeKeys=100-24 294ms ± 0% 293ms ± 1% ~ (p=0.421 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=0.00/numRangeKeys=0-24 782ms ± 0% 788ms ± 1% +0.81% (p=0.008 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=0.00/numRangeKeys=1-24 901ms ± 0% 906ms ± 0% +0.55% (p=0.008 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=0.00/numRangeKeys=100-24 918ms ± 1% 920ms ± 0% ~ (p=0.310 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=50.00/numRangeKeys=0-24 663ms ± 1% 671ms ± 0% +1.21% (p=0.008 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=50.00/numRangeKeys=1-24 793ms ± 0% 799ms ± 0% +0.68% (p=0.008 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=50.00/numRangeKeys=100-24 803ms ± 0% 813ms ± 1% +1.25% (p=0.008 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=75.00/numRangeKeys=0-24 594ms ± 0% 601ms ± 0% +1.28% (p=0.008 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=75.00/numRangeKeys=1-24 722ms ± 0% 730ms ± 1% +1.17% (p=0.008 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=75.00/numRangeKeys=100-24 733ms ± 0% 742ms ± 1% +1.20% (p=0.008 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=95.00/numRangeKeys=0-24 172ms ± 0% 170ms ± 1% -0.70% (p=0.032 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=95.00/numRangeKeys=1-24 194ms ± 0% 194ms ± 1% ~ (p=0.421 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=95.00/numRangeKeys=100-24 303ms ± 0% 303ms ± 1% ~ (p=0.841 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=99.00/numRangeKeys=0-24 153ms ± 0% 154ms ± 0% +0.59% (p=0.016 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=99.00/numRangeKeys=1-24 177ms ± 1% 177ms ± 1% ~ (p=0.690 n=5+5) CatchUpScan/mixed-case/withDiff=false/perc=99.00/numRangeKeys=100-24 288ms ± 1% 288ms ± 0% ~ (p=0.841 n=5+5) ``` Release justification: bug fixes and low-risk updates to new functionality Release note: None 86521: storage: optimize `MVCCExportToSST` range key processing r=tbg a=erikgrinaker This patch optimizes `MVCCExportToSST` by making use of `RangeKeyChanged()`, `CloneInto()`, and `PutRawMVCCRangeKey()`. Unfortunately, this did not appear to have a significant impact on performance in the 0/1 range key cases, as most of the gains were already realized by previously migrating `MVCCIncrementalIterator` to `RangeKeyChanged()`. ``` name old time/op new time/op delta MVCCExportToSST/numKeys=64/numRevisions=1/exportAllRevisions=false/numRangeKeys=0-24 69.8µs ± 0% 69.9µs ± 1% ~ (p=0.841 n=5+5) MVCCExportToSST/numKeys=64/numRevisions=1/exportAllRevisions=false/numRangeKeys=1-24 116µs ± 7% 113µs ± 6% ~ (p=0.548 n=5+5) MVCCExportToSST/numKeys=64/numRevisions=1/exportAllRevisions=true/numRangeKeys=0-24 66.9µs ± 1% 66.6µs ± 1% ~ (p=0.151 n=5+5) MVCCExportToSST/numKeys=64/numRevisions=1/exportAllRevisions=true/numRangeKeys=1-24 98.4µs ± 7% 105.6µs ± 4% ~ (p=0.095 n=5+5) MVCCExportToSST/numKeys=64/numRevisions=10/exportAllRevisions=false/numRangeKeys=0-24 171µs ± 4% 166µs ± 4% ~ (p=0.222 n=5+5) MVCCExportToSST/numKeys=64/numRevisions=10/exportAllRevisions=false/numRangeKeys=1-24 229µs ± 4% 230µs ± 3% ~ (p=0.841 n=5+5) MVCCExportToSST/numKeys=64/numRevisions=10/exportAllRevisions=true/numRangeKeys=0-24 277µs ± 3% 270µs ± 2% ~ (p=0.151 n=5+5) MVCCExportToSST/numKeys=64/numRevisions=10/exportAllRevisions=true/numRangeKeys=1-24 345µs ± 2% 346µs ± 1% ~ (p=1.000 n=5+5) MVCCExportToSST/numKeys=1024/numRevisions=1/exportAllRevisions=false/numRangeKeys=0-24 617µs ± 1% 614µs ± 1% ~ (p=0.310 n=5+5) MVCCExportToSST/numKeys=1024/numRevisions=1/exportAllRevisions=false/numRangeKeys=1-24 762µs ± 1% 756µs ± 1% ~ (p=0.151 n=5+5) MVCCExportToSST/numKeys=1024/numRevisions=1/exportAllRevisions=true/numRangeKeys=0-24 571µs ± 2% 556µs ± 1% -2.60% (p=0.032 n=5+5) MVCCExportToSST/numKeys=1024/numRevisions=1/exportAllRevisions=true/numRangeKeys=1-24 705µs ± 1% 700µs ± 1% ~ (p=0.222 n=5+5) MVCCExportToSST/numKeys=1024/numRevisions=10/exportAllRevisions=false/numRangeKeys=0-24 2.17ms ± 0% 2.19ms ± 1% +0.80% (p=0.008 n=5+5) MVCCExportToSST/numKeys=1024/numRevisions=10/exportAllRevisions=false/numRangeKeys=1-24 2.87ms ± 1% 2.91ms ± 1% +1.53% (p=0.032 n=5+5) MVCCExportToSST/numKeys=1024/numRevisions=10/exportAllRevisions=true/numRangeKeys=0-24 3.80ms ± 0% 3.79ms ± 1% ~ (p=0.548 n=5+5) MVCCExportToSST/numKeys=1024/numRevisions=10/exportAllRevisions=true/numRangeKeys=1-24 4.77ms ± 0% 4.75ms ± 0% ~ (p=0.095 n=5+5) MVCCExportToSST/numKeys=8192/numRevisions=1/exportAllRevisions=false/numRangeKeys=0-24 4.63ms ± 1% 4.57ms ± 1% -1.24% (p=0.008 n=5+5) MVCCExportToSST/numKeys=8192/numRevisions=1/exportAllRevisions=false/numRangeKeys=1-24 5.61ms ± 0% 5.65ms ± 1% +0.66% (p=0.032 n=5+5) MVCCExportToSST/numKeys=8192/numRevisions=1/exportAllRevisions=true/numRangeKeys=0-24 4.21ms ± 1% 4.14ms ± 0% -1.69% (p=0.008 n=5+5) MVCCExportToSST/numKeys=8192/numRevisions=1/exportAllRevisions=true/numRangeKeys=1-24 5.23ms ± 0% 5.17ms ± 1% -1.16% (p=0.008 n=5+5) MVCCExportToSST/numKeys=8192/numRevisions=10/exportAllRevisions=false/numRangeKeys=0-24 17.6ms ± 1% 17.8ms ± 2% ~ (p=0.222 n=5+5) MVCCExportToSST/numKeys=8192/numRevisions=10/exportAllRevisions=false/numRangeKeys=1-24 23.3ms ± 0% 23.6ms ± 0% +1.10% (p=0.008 n=5+5) MVCCExportToSST/numKeys=8192/numRevisions=10/exportAllRevisions=true/numRangeKeys=0-24 30.9ms ± 0% 30.7ms ± 0% -0.51% (p=0.008 n=5+5) MVCCExportToSST/numKeys=8192/numRevisions=10/exportAllRevisions=true/numRangeKeys=1-24 38.5ms ± 0% 38.4ms ± 0% ~ (p=0.310 n=5+5) MVCCExportToSST/numKeys=65536/numRevisions=1/exportAllRevisions=false/numRangeKeys=0-24 36.6ms ± 0% 36.1ms ± 1% -1.46% (p=0.008 n=5+5) MVCCExportToSST/numKeys=65536/numRevisions=1/exportAllRevisions=false/numRangeKeys=1-24 44.5ms ± 0% 44.6ms ± 0% ~ (p=0.310 n=5+5) MVCCExportToSST/numKeys=65536/numRevisions=1/exportAllRevisions=true/numRangeKeys=0-24 33.4ms ± 1% 32.8ms ± 0% -1.70% (p=0.008 n=5+5) MVCCExportToSST/numKeys=65536/numRevisions=1/exportAllRevisions=true/numRangeKeys=1-24 41.1ms ± 1% 40.7ms ± 0% -1.04% (p=0.008 n=5+5) MVCCExportToSST/numKeys=65536/numRevisions=10/exportAllRevisions=false/numRangeKeys=0-24 152ms ± 1% 152ms ± 4% ~ (p=1.000 n=5+5) MVCCExportToSST/numKeys=65536/numRevisions=10/exportAllRevisions=false/numRangeKeys=1-24 197ms ± 0% 200ms ± 0% +1.61% (p=0.008 n=5+5) MVCCExportToSST/numKeys=65536/numRevisions=10/exportAllRevisions=true/numRangeKeys=0-24 255ms ± 1% 253ms ± 0% -0.56% (p=0.032 n=5+5) MVCCExportToSST/numKeys=65536/numRevisions=10/exportAllRevisions=true/numRangeKeys=1-24 314ms ± 0% 314ms ± 0% ~ (p=0.730 n=4+5) ``` Release justification: bug fixes and low-risk updates to new functionality Release note: None Co-authored-by: Erik Grinaker <[email protected]>
- Loading branch information