-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kvserver: RefreshRange performance regression #98881
Comments
$ benchdiff --old=81a114c --new=master --post-checkout='dev generate go' --run='BenchmarkRefreshRange' ./pkg/kv/kvserver/batcheval
name old time/op new time/op delta
RefreshRange/linear-keys/refresh_window=[95.00,95.00]-30 135µs ± 1% 130µs ± 1% -3.93% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[75.00,75.00]-30 135µs ± 1% 130µs ± 1% -3.86% (p=0.000 n=9+9)
RefreshRange/linear-keys/refresh_window=[0.00,0.00]-30 144µs ± 1% 138µs ± 1% -3.81% (p=0.000 n=9+10)
RefreshRange/linear-keys/refresh_window=[50.00,50.00]-30 144µs ± 0% 139µs ± 1% -3.68% (p=0.000 n=9+8)
RefreshRange/linear-keys/refresh_window=[99.00,99.00]-30 136µs ± 1% 131µs ± 1% -3.44% (p=0.000 n=10+9)
RefreshRange/random-keys/refresh_window=[0.00,0.00]-30 288µs ± 1% 288µs ± 1% ~ (p=0.912 n=10+10)
RefreshRange/random-keys/refresh_window=[50.00,50.00]-30 553ms ± 0% 617ms ± 1% +11.63% (p=0.000 n=9+9)
RefreshRange/mixed-case/refresh_window=[0.00,0.00]-30 320µs ± 0% 373µs ± 0% +16.62% (p=0.000 n=9+9)
RefreshRange/linear-keys/refresh_window=[75.00,99.00]-30 36.7µs ± 1% 43.2µs ± 0% +17.76% (p=0.000 n=10+9)
RefreshRange/linear-keys/refresh_window=[75.00,95.00]-30 36.6µs ± 1% 43.3µs ± 1% +18.11% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[95.00,99.00]-30 40.9µs ± 1% 48.5µs ± 1% +18.63% (p=0.000 n=9+10)
RefreshRange/linear-keys/refresh_window=[50.00,75.00]-30 32.4µs ± 1% 39.3µs ± 1% +21.44% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[50.00,95.00]-30 32.4µs ± 1% 39.4µs ± 1% +21.67% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[50.00,99.00]-30 32.4µs ± 0% 39.4µs ± 1% +21.72% (p=0.000 n=9+10)
RefreshRange/random-keys/refresh_window=[95.00,99.00]-30 31.0µs ± 1% 38.2µs ± 1% +23.30% (p=0.000 n=9+9)
RefreshRange/random-keys/refresh_window=[75.00,75.00]-30 278ms ± 1% 348ms ± 1% +25.33% (p=0.000 n=9+10)
RefreshRange/mixed-case/refresh_window=[95.00,95.00]-30 791µs ± 1% 997µs ± 1% +25.98% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[0.00,50.00]-30 24.2µs ± 1% 31.1µs ± 0% +28.69% (p=0.000 n=9+8)
RefreshRange/random-keys/refresh_window=[99.00,99.00]-30 369ms ± 1% 481ms ± 1% +30.22% (p=0.000 n=10+9)
RefreshRange/random-keys/refresh_window=[95.00,95.00]-30 369ms ± 1% 482ms ± 0% +30.52% (p=0.000 n=10+8)
RefreshRange/linear-keys/refresh_window=[0.00,95.00]-30 19.3µs ± 1% 25.5µs ± 1% +31.98% (p=0.000 n=9+10)
RefreshRange/linear-keys/refresh_window=[0.00,75.00]-30 19.3µs ± 1% 25.5µs ± 1% +32.05% (p=0.000 n=9+10)
RefreshRange/linear-keys/refresh_window=[0.00,99.00]-30 19.3µs ± 1% 25.5µs ± 1% +32.06% (p=0.000 n=9+9)
RefreshRange/random-keys/refresh_window=[50.00,95.00]-30 19.4µs ± 1% 25.7µs ± 1% +32.20% (p=0.000 n=10+9)
RefreshRange/random-keys/refresh_window=[50.00,75.00]-30 25.5µs ± 1% 33.8µs ± 1% +32.35% (p=0.000 n=9+9)
RefreshRange/random-keys/refresh_window=[50.00,99.00]-30 19.4µs ± 1% 25.7µs ± 1% +32.41% (p=0.000 n=10+9)
RefreshRange/mixed-case/refresh_window=[75.00,75.00]-30 456ms ± 1% 606ms ± 1% +33.02% (p=0.000 n=9+10)
RefreshRange/random-keys/refresh_window=[0.00,95.00]-30 18.8µs ± 1% 25.2µs ± 1% +33.99% (p=0.000 n=10+9)
RefreshRange/mixed-case/refresh_window=[50.00,50.00]-30 451ms ± 1% 608ms ± 1% +34.61% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[0.00,99.00]-30 18.7µs ± 1% 25.2µs ± 1% +34.64% (p=0.000 n=9+9)
RefreshRange/random-keys/refresh_window=[0.00,75.00]-30 21.1µs ± 1% 29.3µs ± 0% +38.79% (p=0.000 n=9+9)
RefreshRange/mixed-case/refresh_window=[0.00,50.00]-30 21.1µs ± 1% 29.4µs ± 1% +39.11% (p=0.000 n=9+10)
RefreshRange/mixed-case/refresh_window=[0.00,75.00]-30 21.1µs ± 0% 29.4µs ± 1% +39.37% (p=0.000 n=9+10)
RefreshRange/mixed-case/refresh_window=[50.00,95.00]-30 22.8µs ± 1% 31.9µs ± 0% +40.05% (p=0.000 n=10+7)
RefreshRange/mixed-case/refresh_window=[75.00,95.00]-30 22.8µs ± 1% 31.9µs ± 1% +40.08% (p=0.000 n=10+9)
RefreshRange/mixed-case/refresh_window=[50.00,75.00]-30 25.4µs ± 1% 35.6µs ± 1% +40.16% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[75.00,99.00]-30 21.6µs ± 1% 30.4µs ± 1% +40.79% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[50.00,99.00]-30 21.6µs ± 1% 30.5µs ± 0% +41.12% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[95.00,99.00]-30 20.5µs ± 0% 28.9µs ± 1% +41.15% (p=0.000 n=8+10)
RefreshRange/mixed-case/refresh_window=[0.00,95.00]-30 22.2µs ± 1% 31.4µs ± 1% +41.54% (p=0.000 n=9+10)
RefreshRange/mixed-case/refresh_window=[0.00,99.00]-30 21.0µs ± 1% 29.9µs ± 1% +42.42% (p=0.000 n=9+9)
RefreshRange/random-keys/refresh_window=[0.00,50.00]-30 21.0µs ± 1% 31.3µs ± 1% +48.85% (p=0.000 n=10+9)
RefreshRange/random-keys/refresh_window=[75.00,99.00]-30 24.1µs ± 1% 36.0µs ± 1% +49.55% (p=0.000 n=10+9)
RefreshRange/random-keys/refresh_window=[75.00,95.00]-30 24.1µs ± 1% 36.1µs ± 1% +50.14% (p=0.000 n=10+9)
RefreshRange/mixed-case/refresh_window=[99.00,99.00]-30 135ms ± 1% 216ms ± 1% +59.68% (p=0.000 n=10+10)
name old alloc/op new alloc/op delta
RefreshRange/mixed-case/refresh_window=[0.00,0.00]-30 2.04kB ± 0% 1.67kB ± 0% -18.14% (p=0.000 n=8+10)
RefreshRange/mixed-case/refresh_window=[95.00,95.00]-30 2.10kB ± 0% 1.74kB ± 0% -17.20% (p=0.000 n=8+10)
RefreshRange/linear-keys/refresh_window=[0.00,0.00]-30 4.96kB ± 0% 4.71kB ± 0% -4.88% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[50.00,50.00]-30 4.96kB ± 0% 4.72kB ± 0% -4.77% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[75.00,75.00]-30 4.95kB ± 0% 4.72kB ± 0% -4.74% (p=0.000 n=10+9)
RefreshRange/linear-keys/refresh_window=[99.00,99.00]-30 4.95kB ± 0% 4.72kB ± 0% -4.74% (p=0.000 n=10+9)
RefreshRange/linear-keys/refresh_window=[95.00,95.00]-30 4.95kB ± 0% 4.72kB ± 0% -4.69% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[0.00,75.00]-30 9.10kB ± 0% 9.81kB ± 0% +7.83% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[50.00,75.00]-30 9.10kB ± 0% 9.82kB ± 0% +7.90% (p=0.000 n=10+9)
RefreshRange/random-keys/refresh_window=[0.00,0.00]-30 3.49kB ± 0% 3.80kB ± 0% +8.76% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[50.00,95.00]-30 8.96kB ± 0% 9.77kB ± 0% +9.08% (p=0.000 n=10+9)
RefreshRange/mixed-case/refresh_window=[0.00,95.00]-30 8.96kB ± 0% 9.77kB ± 0% +9.08% (p=0.000 n=9+10)
RefreshRange/mixed-case/refresh_window=[75.00,95.00]-30 8.95kB ± 0% 9.77kB ± 0% +9.17% (p=0.000 n=8+8)
RefreshRange/linear-keys/refresh_window=[75.00,99.00]-30 11.3kB ± 0% 12.4kB ± 0% +9.22% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[0.00,99.00]-30 8.85kB ± 0% 9.66kB ± 0% +9.23% (p=0.000 n=10+9)
RefreshRange/linear-keys/refresh_window=[75.00,95.00]-30 11.3kB ± 0% 12.4kB ± 0% +9.24% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[75.00,99.00]-30 8.85kB ± 0% 9.67kB ± 0% +9.25% (p=0.000 n=10+8)
RefreshRange/mixed-case/refresh_window=[50.00,99.00]-30 8.85kB ± 0% 9.67kB ± 0% +9.27% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[95.00,99.00]-30 12.0kB ± 0% 13.1kB ± 0% +9.52% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[0.00,50.00]-30 9.12kB ± 0% 10.02kB ± 0% +9.87% (p=0.000 n=10+9)
RefreshRange/mixed-case/refresh_window=[0.00,75.00]-30 9.12kB ± 0% 10.02kB ± 0% +9.88% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[50.00,75.00]-30 9.12kB ± 0% 10.02kB ± 0% +9.90% (p=0.000 n=8+10)
RefreshRange/linear-keys/refresh_window=[50.00,99.00]-30 10.5kB ± 0% 11.5kB ± 0% +10.00% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[50.00,75.00]-30 10.5kB ± 0% 11.5kB ± 0% +10.03% (p=0.000 n=9+10)
RefreshRange/mixed-case/refresh_window=[95.00,99.00]-30 9.01kB ± 0% 9.92kB ± 0% +10.05% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[50.00,95.00]-30 10.4kB ± 0% 11.5kB ± 0% +10.06% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[95.00,95.00]-30 71.4kB ± 4% 78.8kB ±14% +10.34% (p=0.016 n=8+10)
RefreshRange/random-keys/refresh_window=[95.00,99.00]-30 10.1kB ± 0% 11.2kB ± 0% +10.39% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[0.00,95.00]-30 8.65kB ± 0% 9.61kB ± 0% +11.03% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[50.00,95.00]-30 8.65kB ± 0% 9.61kB ± 0% +11.04% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[50.00,99.00]-30 8.65kB ± 0% 9.61kB ± 0% +11.07% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[0.00,50.00]-30 9.46kB ± 0% 10.51kB ± 0% +11.09% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[0.00,99.00]-30 8.65kB ± 0% 9.61kB ± 0% +11.10% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[0.00,95.00]-30 8.65kB ± 0% 9.61kB ± 0% +11.12% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[0.00,99.00]-30 8.65kB ± 0% 9.61kB ± 0% +11.12% (p=0.000 n=10+9)
RefreshRange/linear-keys/refresh_window=[0.00,75.00]-30 8.65kB ± 0% 9.61kB ± 0% +11.13% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[99.00,99.00]-30 68.9kB ±13% 77.2kB ±12% +12.03% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[0.00,50.00]-30 9.10kB ± 0% 10.59kB ± 0% +16.38% (p=0.000 n=10+9)
RefreshRange/random-keys/refresh_window=[50.00,50.00]-30 91.4kB ± 9% 107.4kB ± 9% +17.42% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[75.00,95.00]-30 9.38kB ± 0% 11.21kB ± 0% +19.48% (p=0.000 n=9+10)
RefreshRange/random-keys/refresh_window=[75.00,99.00]-30 9.37kB ± 0% 11.20kB ± 0% +19.50% (p=0.000 n=10+9)
RefreshRange/mixed-case/refresh_window=[99.00,99.00]-30 13.0kB ± 0% 20.1kB ± 1% +55.54% (p=0.000 n=8+9)
RefreshRange/random-keys/refresh_window=[75.00,75.00]-30 49.1kB ±11% 76.4kB ± 5% +55.71% (p=0.000 n=10+9)
RefreshRange/mixed-case/refresh_window=[50.00,50.00]-30 26.9kB ±20% 44.5kB ±21% +65.33% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[75.00,75.00]-30 29.1kB ± 1% 48.4kB ± 1% +66.23% (p=0.000 n=8+9)
name old allocs/op new allocs/op delta
RefreshRange/random-keys/refresh_window=[95.00,95.00]-30 865 ± 2% 824 ±23% ~ (p=0.195 n=8+10)
RefreshRange/random-keys/refresh_window=[99.00,99.00]-30 804 ±20% 800 ±20% ~ (p=0.383 n=10+10)
RefreshRange/linear-keys/refresh_window=[0.00,0.00]-30 96.0 ± 0% 98.0 ± 0% +2.08% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[50.00,50.00]-30 96.0 ± 0% 99.0 ± 0% +3.12% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[75.00,75.00]-30 96.0 ± 0% 99.0 ± 0% +3.12% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[95.00,95.00]-30 96.0 ± 0% 99.0 ± 0% +3.12% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[99.00,99.00]-30 96.0 ± 0% 99.0 ± 0% +3.12% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[50.00,50.00]-30 931 ±11% 1026 ±10% +10.23% (p=0.023 n=10+10)
RefreshRange/mixed-case/refresh_window=[95.00,95.00]-30 27.0 ± 0% 30.0 ± 0% +11.11% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[0.00,0.00]-30 26.0 ± 0% 29.0 ± 0% +11.54% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[95.00,99.00]-30 133 ± 0% 154 ± 0% +15.79% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[75.00,95.00]-30 118 ± 0% 137 ± 0% +16.10% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[75.00,99.00]-30 118 ± 0% 137 ± 0% +16.10% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[50.00,75.00]-30 100 ± 0% 119 ± 0% +19.00% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[50.00,95.00]-30 100 ± 0% 119 ± 0% +19.00% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[50.00,99.00]-30 100 ± 0% 119 ± 0% +19.00% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[0.00,75.00]-30 69.0 ± 0% 83.0 ± 0% +20.29% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[50.00,75.00]-30 69.0 ± 0% 83.0 ± 0% +20.29% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[95.00,99.00]-30 92.0 ± 0% 113.0 ± 0% +22.83% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[0.00,0.00]-30 63.0 ± 0% 78.0 ± 0% +23.81% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[0.00,50.00]-30 77.0 ± 0% 97.0 ± 0% +25.97% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[0.00,95.00]-30 63.0 ± 0% 82.0 ± 0% +30.16% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[50.00,95.00]-30 63.0 ± 0% 82.0 ± 0% +30.16% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[75.00,95.00]-30 63.0 ± 0% 82.0 ± 0% +30.16% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[0.00,95.00]-30 59.0 ± 0% 77.0 ± 0% +30.51% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[0.00,99.00]-30 59.0 ± 0% 77.0 ± 0% +30.51% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[50.00,95.00]-30 59.0 ± 0% 77.0 ± 0% +30.51% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[50.00,99.00]-30 59.0 ± 0% 77.0 ± 0% +30.51% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[0.00,75.00]-30 59.0 ± 0% 77.0 ± 0% +30.51% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[0.00,95.00]-30 59.0 ± 0% 77.0 ± 0% +30.51% (p=0.000 n=10+10)
RefreshRange/linear-keys/refresh_window=[0.00,99.00]-30 59.0 ± 0% 77.0 ± 0% +30.51% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[0.00,50.00]-30 65.0 ± 0% 85.0 ± 0% +30.77% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[0.00,75.00]-30 65.0 ± 0% 85.0 ± 0% +30.77% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[50.00,75.00]-30 65.0 ± 0% 85.0 ± 0% +30.77% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[0.00,99.00]-30 60.0 ± 0% 79.0 ± 0% +31.67% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[50.00,99.00]-30 60.0 ± 0% 79.0 ± 0% +31.67% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[75.00,99.00]-30 60.0 ± 0% 79.0 ± 0% +31.67% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[95.00,99.00]-30 62.0 ± 0% 83.0 ± 0% +33.87% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[99.00,99.00]-30 108 ± 0% 150 ± 1% +38.66% (p=0.000 n=8+9)
RefreshRange/random-keys/refresh_window=[75.00,75.00]-30 537 ±15% 746 ± 7% +38.91% (p=0.000 n=10+9)
RefreshRange/random-keys/refresh_window=[0.00,50.00]-30 69.0 ± 0% 99.0 ± 0% +43.48% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[75.00,95.00]-30 76.0 ± 0% 113.0 ± 0% +48.68% (p=0.000 n=10+10)
RefreshRange/random-keys/refresh_window=[75.00,99.00]-30 76.0 ± 0% 113.0 ± 0% +48.68% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[50.00,50.00]-30 177 ±26% 306 ±33% +72.77% (p=0.000 n=10+10)
RefreshRange/mixed-case/refresh_window=[75.00,75.00]-30 195 ± 2% 349 ± 2% +79.15% (p=0.000 n=8+9) |
I think I tracked down the cause of the perf regression for BenchmarkRefreshRange and it seems to be in the conversion of error messages to strings as a result of PCI compliance: The big difference in the time to format the error as part of the regex here:
Here are what the old and new flame graphs look like (notice the big |
After running with the patched version (to remove the expensive assert) the new version still looks worse:
More investigation needed... |
This is interesting. We're not using object storage, so it's worth reaching out to Storage to see whether they expect this |
Removes an unnecessarily expensive assertion from the bench test as it was taking >50% of the runtime. Now the test correctly spends time on the important code. Informs: cockroachdb#98881 Epic: none Release note: None
99520: kv: remove expensive print r=nvanbenschoten a=andrewbaptist Removes an unnecessarily expensive assertion from the bench test as it was taking >50% of the runtime. Now the test correctly spends time on the important code. Informs: #98881 Epic: none Release note: None Co-authored-by: Andrew Baptist <[email protected]>
Removes an unnecessarily expensive assertion from the bench test as it was taking >50% of the runtime. Now the test correctly spends time on the important code. Informs: #98881 Epic: none Release note: None
Thinking about it more, I think all those observations jive with the theory of value blocks increasing the cost of moving to the next visible key. Time-bound iteration happens at the ssblock level at its most granular, so the denser ssblocks cause more out-of-timerange keys to be surfaced up to the MVCC layer. cockroachdb/pebble#1446 describes a related idea that would perform the time-bound filtering at the leaf, avoiding the overhead of bubbling these out-of-bound keys up. @sumeerbhola does this make sense to you? I don't think there's reason to change anything about this release, but maybe there's an argument to revisit cockroachdb/pebble#1446 as value blocks have increased its significance. I'm going to disable value blocks and collect some numbers to get confirmation. |
Dang, this was a miss. Without value blocks, there's only a ~5% improvement on the most regressed
|
Makes sense
What exactly did you do here -- I want to make sure I look at the same thing. |
using Erik's profiles |
I took some new profiles of just the benchmark variant with the largest regression
This seems to show most of the additional time being spent in the |
It does look like we're losing both the monotonic bounds optimization and the
and then the slow path:
|
Looks like there's some variance in this benchmark, and this is value blocks. It's not the case that we're losing the try-seek-using-next optimization. We almost never had it to begin with. The negative duration lines were actually also the slow path, just different line numbers on the old Pebble SHA. They just happened to align with the fast path code block on the new SHA. We almost never hit the TrySeekUsingNext optimization because in the typical case we Next/NextKey the main iterator roughly in tandem with the time-bound iterator. This has been the case since #45785. There are a few mitigations that we could apply:
I don't think this needs to block GA. Removing the label. |
Previously, the minimum and maximum timestamps used to configure a "time-bound" iterator were only hints. The iterator would surface keys outside those bounds frequently if the keys were contained within a sstable block that also contained keys within bounds. This commit adapts the iterator construction to use Pebble's IterOptions.SkipPoint option to filter out-of-range keys without yielding them to the caller. This adds a small additional overhead to processing KVs that are ultimately yielded to the user of a MVCCIncrementalIterator, but removes a large overhead to proessing KVs that are ultimately skipped. In the current MVCCIncrementalIterator implementation, keys that are outside the time range still reposition the iterator without time bound. This repositioning no longer happens, and removing this overhead more than reclaims the RefreshRange benchmark's regression from the introduction value blocks packing keys more densely. This also serves as a step towards cockroachdb#66869. ``` goos: linux goarch: amd64 cpu: Intel(R) Xeon(R) CPU @ 2.80GHz │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ RefreshRange/linear-keys/refresh_window=[0.00,0.00]-24 150.73µ ± 1% 55.75µ ± 1% -63.01% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[0.00,50.00]-24 16.52µ ± 1% 16.19µ ± 2% -2.00% (p=0.005 n=10) RefreshRange/linear-keys/refresh_window=[0.00,75.00]-24 13.94µ ± 1% 13.59µ ± 1% -2.55% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[0.00,95.00]-24 13.97µ ± 1% 13.56µ ± 3% -2.99% (p=0.002 n=10) RefreshRange/linear-keys/refresh_window=[0.00,99.00]-24 13.96µ ± 1% 13.45µ ± 3% -3.69% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,50.00]-24 149.95µ ± 1% 55.67µ ± 1% -62.88% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,75.00]-24 22.05µ ± 1% 21.70µ ± 0% -1.57% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,95.00]-24 22.08µ ± 1% 21.61µ ± 0% -2.14% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,99.00]-24 21.91µ ± 1% 21.69µ ± 1% -0.99% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,75.00]-24 139.27µ ± 1% 55.82µ ± 1% -59.92% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,95.00]-24 23.76µ ± 1% 23.36µ ± 0% -1.66% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,99.00]-24 23.85µ ± 1% 23.25µ ± 1% -2.48% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[95.00,95.00]-24 138.94µ ± 1% 55.52µ ± 0% -60.04% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[95.00,99.00]-24 26.68µ ± 1% 26.30µ ± 1% -1.42% (p=0.005 n=10) RefreshRange/linear-keys/refresh_window=[99.00,99.00]-24 141.39µ ± 1% 55.02µ ± 1% -61.09% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[0.00,0.00]-24 322.35µ ± 0% 51.21µ ± 0% -84.11% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[0.00,50.00]-24 16.35µ ± 1% 16.63µ ± 2% ~ (p=0.105 n=10) RefreshRange/random-keys/refresh_window=[0.00,75.00]-24 17.42µ ± 1% 17.29µ ± 3% ~ (p=0.796 n=10) RefreshRange/random-keys/refresh_window=[0.00,95.00]-24 13.40µ ± 1% 13.45µ ± 1% ~ (p=0.529 n=10) RefreshRange/random-keys/refresh_window=[0.00,99.00]-24 13.59µ ± 2% 13.41µ ± 0% ~ (p=0.239 n=10) RefreshRange/random-keys/refresh_window=[50.00,50.00]-24 707.5m ± 1% 111.7m ± 1% -84.21% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,75.00]-24 21.94µ ± 1% 17.86µ ± 0% -18.59% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,95.00]-24 13.95µ ± 1% 13.54µ ± 1% -2.94% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,99.00]-24 13.96µ ± 0% 13.53µ ± 1% -3.06% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[75.00,75.00]-24 395.22m ± 0% 33.81m ± 1% -91.45% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[75.00,95.00]-24 19.42µ ± 1% 19.40µ ± 1% ~ (p=0.912 n=10) RefreshRange/random-keys/refresh_window=[75.00,99.00]-24 19.37µ ± 1% 19.42µ ± 1% ~ (p=0.247 n=10) RefreshRange/random-keys/refresh_window=[95.00,95.00]-24 546.66m ± 3% 48.48m ± 3% -91.13% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[95.00,99.00]-24 21.69µ ± 1% 19.68µ ± 1% -9.24% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[99.00,99.00]-24 546.27m ± 0% 48.73m ± 3% -91.08% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[0.00,0.00]-24 410.1µ ± 0% 221.1µ ± 1% -46.09% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[0.00,50.00]-24 14.84µ ± 1% 14.84µ ± 1% ~ (p=0.739 n=10) RefreshRange/mixed-case/refresh_window=[0.00,75.00]-24 14.84µ ± 1% 14.83µ ± 1% ~ (p=0.615 n=10) RefreshRange/mixed-case/refresh_window=[0.00,95.00]-24 17.39µ ± 2% 17.51µ ± 2% +0.68% (p=0.029 n=10) RefreshRange/mixed-case/refresh_window=[0.00,99.00]-24 16.41µ ± 1% 16.38µ ± 1% ~ (p=0.971 n=10) RefreshRange/mixed-case/refresh_window=[50.00,50.00]-24 660.9m ± 0% 140.6m ± 3% -78.73% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,75.00]-24 20.43µ ± 1% 15.46µ ± 1% -24.31% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,95.00]-24 18.03µ ± 1% 17.66µ ± 1% -2.01% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,99.00]-24 16.86µ ± 1% 16.70µ ± 1% -0.93% (p=0.011 n=10) RefreshRange/mixed-case/refresh_window=[75.00,75.00]-24 659.5m ± 1% 137.1m ± 3% -79.21% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[75.00,95.00]-24 17.96µ ± 1% 17.65µ ± 1% -1.77% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[75.00,99.00]-24 16.86µ ± 1% 16.66µ ± 1% -1.23% (p=0.008 n=10) RefreshRange/mixed-case/refresh_window=[95.00,95.00]-24 900.95µ ± 0% 32.18µ ± 0% -96.43% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[95.00,99.00]-24 14.35µ ± 1% 14.50µ ± 2% +1.03% (p=0.002 n=10) RefreshRange/mixed-case/refresh_window=[99.00,99.00]-24 227.235m ± 1% 3.361m ± 1% -98.52% (p=0.000 n=10) geomean 136.9µ 73.57µ -46.24% goos: linux goarch: amd64 cpu: Intel(R) Xeon(R) CPU @ 2.80GHz │ old2.txt │ new2.txt │ │ sec/op │ sec/op vs base │ MVCCIncrementalIterator/ts=5-24 24.93m ± 3% 24.53m ± 2% -1.61% (p=0.004 n=10) MVCCIncrementalIterator/ts=480-24 560.4µ ± 1% 453.8µ ± 0% -19.02% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=100-24 1.444m ± 0% 1.434m ± 0% -0.72% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=500-24 1.994m ± 0% 1.974m ± 1% -1.02% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=1000-24 2.672m ± 1% 2.649m ± 1% ~ (p=0.063 n=10) MVCCIncrementalIteratorForOldData/valueSize=2000-24 4.059m ± 1% 4.009m ± 1% -1.23% (p=0.011 n=10) geomean 2.754m 2.635m -4.33% ``` Epic: none Informs cockroachdb#66869 Close cockroachdb#98881 Release note: none
Previously, the minimum and maximum timestamps used to configure a "time-bound" iterator were only hints. The iterator would surface keys outside those bounds frequently if the keys were contained within a sstable block that also contained keys within bounds. This commit adapts the iterator construction to use Pebble's IterOptions.SkipPoint option to filter out-of-range keys without yielding them to the caller. This adds a small additional overhead to processing KVs that are ultimately yielded to the user of a MVCCIncrementalIterator, but removes a large overhead to proessing KVs that are ultimately skipped. In the current MVCCIncrementalIterator implementation, keys that are outside the time range still reposition the iterator without time bound. This repositioning no longer happens, and removing this overhead more than reclaims the RefreshRange benchmark's regression from the introduction of value blocks that resulted in packing keys more densely. This also serves as a step towards cockroachdb#66869. ``` goos: linux goarch: amd64 cpu: Intel(R) Xeon(R) CPU @ 2.80GHz │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ RefreshRange/linear-keys/refresh_window=[0.00,0.00]-24 150.73µ ± 1% 55.75µ ± 1% -63.01% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[0.00,50.00]-24 16.52µ ± 1% 16.19µ ± 2% -2.00% (p=0.005 n=10) RefreshRange/linear-keys/refresh_window=[0.00,75.00]-24 13.94µ ± 1% 13.59µ ± 1% -2.55% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[0.00,95.00]-24 13.97µ ± 1% 13.56µ ± 3% -2.99% (p=0.002 n=10) RefreshRange/linear-keys/refresh_window=[0.00,99.00]-24 13.96µ ± 1% 13.45µ ± 3% -3.69% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,50.00]-24 149.95µ ± 1% 55.67µ ± 1% -62.88% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,75.00]-24 22.05µ ± 1% 21.70µ ± 0% -1.57% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,95.00]-24 22.08µ ± 1% 21.61µ ± 0% -2.14% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,99.00]-24 21.91µ ± 1% 21.69µ ± 1% -0.99% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,75.00]-24 139.27µ ± 1% 55.82µ ± 1% -59.92% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,95.00]-24 23.76µ ± 1% 23.36µ ± 0% -1.66% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,99.00]-24 23.85µ ± 1% 23.25µ ± 1% -2.48% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[95.00,95.00]-24 138.94µ ± 1% 55.52µ ± 0% -60.04% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[95.00,99.00]-24 26.68µ ± 1% 26.30µ ± 1% -1.42% (p=0.005 n=10) RefreshRange/linear-keys/refresh_window=[99.00,99.00]-24 141.39µ ± 1% 55.02µ ± 1% -61.09% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[0.00,0.00]-24 322.35µ ± 0% 51.21µ ± 0% -84.11% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[0.00,50.00]-24 16.35µ ± 1% 16.63µ ± 2% ~ (p=0.105 n=10) RefreshRange/random-keys/refresh_window=[0.00,75.00]-24 17.42µ ± 1% 17.29µ ± 3% ~ (p=0.796 n=10) RefreshRange/random-keys/refresh_window=[0.00,95.00]-24 13.40µ ± 1% 13.45µ ± 1% ~ (p=0.529 n=10) RefreshRange/random-keys/refresh_window=[0.00,99.00]-24 13.59µ ± 2% 13.41µ ± 0% ~ (p=0.239 n=10) RefreshRange/random-keys/refresh_window=[50.00,50.00]-24 707.5m ± 1% 111.7m ± 1% -84.21% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,75.00]-24 21.94µ ± 1% 17.86µ ± 0% -18.59% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,95.00]-24 13.95µ ± 1% 13.54µ ± 1% -2.94% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,99.00]-24 13.96µ ± 0% 13.53µ ± 1% -3.06% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[75.00,75.00]-24 395.22m ± 0% 33.81m ± 1% -91.45% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[75.00,95.00]-24 19.42µ ± 1% 19.40µ ± 1% ~ (p=0.912 n=10) RefreshRange/random-keys/refresh_window=[75.00,99.00]-24 19.37µ ± 1% 19.42µ ± 1% ~ (p=0.247 n=10) RefreshRange/random-keys/refresh_window=[95.00,95.00]-24 546.66m ± 3% 48.48m ± 3% -91.13% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[95.00,99.00]-24 21.69µ ± 1% 19.68µ ± 1% -9.24% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[99.00,99.00]-24 546.27m ± 0% 48.73m ± 3% -91.08% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[0.00,0.00]-24 410.1µ ± 0% 221.1µ ± 1% -46.09% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[0.00,50.00]-24 14.84µ ± 1% 14.84µ ± 1% ~ (p=0.739 n=10) RefreshRange/mixed-case/refresh_window=[0.00,75.00]-24 14.84µ ± 1% 14.83µ ± 1% ~ (p=0.615 n=10) RefreshRange/mixed-case/refresh_window=[0.00,95.00]-24 17.39µ ± 2% 17.51µ ± 2% +0.68% (p=0.029 n=10) RefreshRange/mixed-case/refresh_window=[0.00,99.00]-24 16.41µ ± 1% 16.38µ ± 1% ~ (p=0.971 n=10) RefreshRange/mixed-case/refresh_window=[50.00,50.00]-24 660.9m ± 0% 140.6m ± 3% -78.73% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,75.00]-24 20.43µ ± 1% 15.46µ ± 1% -24.31% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,95.00]-24 18.03µ ± 1% 17.66µ ± 1% -2.01% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,99.00]-24 16.86µ ± 1% 16.70µ ± 1% -0.93% (p=0.011 n=10) RefreshRange/mixed-case/refresh_window=[75.00,75.00]-24 659.5m ± 1% 137.1m ± 3% -79.21% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[75.00,95.00]-24 17.96µ ± 1% 17.65µ ± 1% -1.77% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[75.00,99.00]-24 16.86µ ± 1% 16.66µ ± 1% -1.23% (p=0.008 n=10) RefreshRange/mixed-case/refresh_window=[95.00,95.00]-24 900.95µ ± 0% 32.18µ ± 0% -96.43% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[95.00,99.00]-24 14.35µ ± 1% 14.50µ ± 2% +1.03% (p=0.002 n=10) RefreshRange/mixed-case/refresh_window=[99.00,99.00]-24 227.235m ± 1% 3.361m ± 1% -98.52% (p=0.000 n=10) geomean 136.9µ 73.57µ -46.24% goos: linux goarch: amd64 cpu: Intel(R) Xeon(R) CPU @ 2.80GHz │ old2.txt │ new2.txt │ │ sec/op │ sec/op vs base │ MVCCIncrementalIterator/ts=5-24 24.93m ± 3% 24.53m ± 2% -1.61% (p=0.004 n=10) MVCCIncrementalIterator/ts=480-24 560.4µ ± 1% 453.8µ ± 0% -19.02% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=100-24 1.444m ± 0% 1.434m ± 0% -0.72% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=500-24 1.994m ± 0% 1.974m ± 1% -1.02% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=1000-24 2.672m ± 1% 2.649m ± 1% ~ (p=0.063 n=10) MVCCIncrementalIteratorForOldData/valueSize=2000-24 4.059m ± 1% 4.009m ± 1% -1.23% (p=0.011 n=10) geomean 2.754m 2.635m -4.33% ``` Epic: none Informs cockroachdb#66869 Close cockroachdb#98881 Release note: none wip
111338: storage: strengthen time-bound iteration guarantees r=sumeerbhola a=jbowens Previously, the minimum and maximum timestamps used to configure a "time-bound" iterator were only hints. The iterator would surface keys outside those bounds frequently if the keys were contained within a sstable block that also contained keys within bounds. This commit adapts the iterator construction to use Pebble's IterOptions.SkipPoint option to filter out-of-range keys without yielding them to the caller. This adds a small additional overhead to processing KVs that are ultimately yielded to the user of a MVCCIncrementalIterator, but removes a large overhead to proessing KVs that are ultimately skipped. In the current MVCCIncrementalIterator implementation, keys that are outside the time range still reposition the iterator without time bounds. This repositioning no longer happens, and removing this overhead more than reclaims the RefreshRange benchmark's regression from value blocks packing keys more densely. This also serves as a step towards #66869. ``` goos: linux goarch: amd64 cpu: Intel(R) Xeon(R) CPU @ 2.80GHz │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ RefreshRange/linear-keys/refresh_window=[0.00,0.00]-24 150.73µ ± 1% 55.75µ ± 1% -63.01% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[0.00,50.00]-24 16.52µ ± 1% 16.19µ ± 2% -2.00% (p=0.005 n=10) RefreshRange/linear-keys/refresh_window=[0.00,75.00]-24 13.94µ ± 1% 13.59µ ± 1% -2.55% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[0.00,95.00]-24 13.97µ ± 1% 13.56µ ± 3% -2.99% (p=0.002 n=10) RefreshRange/linear-keys/refresh_window=[0.00,99.00]-24 13.96µ ± 1% 13.45µ ± 3% -3.69% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,50.00]-24 149.95µ ± 1% 55.67µ ± 1% -62.88% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,75.00]-24 22.05µ ± 1% 21.70µ ± 0% -1.57% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,95.00]-24 22.08µ ± 1% 21.61µ ± 0% -2.14% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,99.00]-24 21.91µ ± 1% 21.69µ ± 1% -0.99% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,75.00]-24 139.27µ ± 1% 55.82µ ± 1% -59.92% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,95.00]-24 23.76µ ± 1% 23.36µ ± 0% -1.66% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,99.00]-24 23.85µ ± 1% 23.25µ ± 1% -2.48% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[95.00,95.00]-24 138.94µ ± 1% 55.52µ ± 0% -60.04% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[95.00,99.00]-24 26.68µ ± 1% 26.30µ ± 1% -1.42% (p=0.005 n=10) RefreshRange/linear-keys/refresh_window=[99.00,99.00]-24 141.39µ ± 1% 55.02µ ± 1% -61.09% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[0.00,0.00]-24 322.35µ ± 0% 51.21µ ± 0% -84.11% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[0.00,50.00]-24 16.35µ ± 1% 16.63µ ± 2% ~ (p=0.105 n=10) RefreshRange/random-keys/refresh_window=[0.00,75.00]-24 17.42µ ± 1% 17.29µ ± 3% ~ (p=0.796 n=10) RefreshRange/random-keys/refresh_window=[0.00,95.00]-24 13.40µ ± 1% 13.45µ ± 1% ~ (p=0.529 n=10) RefreshRange/random-keys/refresh_window=[0.00,99.00]-24 13.59µ ± 2% 13.41µ ± 0% ~ (p=0.239 n=10) RefreshRange/random-keys/refresh_window=[50.00,50.00]-24 707.5m ± 1% 111.7m ± 1% -84.21% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,75.00]-24 21.94µ ± 1% 17.86µ ± 0% -18.59% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,95.00]-24 13.95µ ± 1% 13.54µ ± 1% -2.94% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,99.00]-24 13.96µ ± 0% 13.53µ ± 1% -3.06% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[75.00,75.00]-24 395.22m ± 0% 33.81m ± 1% -91.45% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[75.00,95.00]-24 19.42µ ± 1% 19.40µ ± 1% ~ (p=0.912 n=10) RefreshRange/random-keys/refresh_window=[75.00,99.00]-24 19.37µ ± 1% 19.42µ ± 1% ~ (p=0.247 n=10) RefreshRange/random-keys/refresh_window=[95.00,95.00]-24 546.66m ± 3% 48.48m ± 3% -91.13% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[95.00,99.00]-24 21.69µ ± 1% 19.68µ ± 1% -9.24% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[99.00,99.00]-24 546.27m ± 0% 48.73m ± 3% -91.08% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[0.00,0.00]-24 410.1µ ± 0% 221.1µ ± 1% -46.09% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[0.00,50.00]-24 14.84µ ± 1% 14.84µ ± 1% ~ (p=0.739 n=10) RefreshRange/mixed-case/refresh_window=[0.00,75.00]-24 14.84µ ± 1% 14.83µ ± 1% ~ (p=0.615 n=10) RefreshRange/mixed-case/refresh_window=[0.00,95.00]-24 17.39µ ± 2% 17.51µ ± 2% +0.68% (p=0.029 n=10) RefreshRange/mixed-case/refresh_window=[0.00,99.00]-24 16.41µ ± 1% 16.38µ ± 1% ~ (p=0.971 n=10) RefreshRange/mixed-case/refresh_window=[50.00,50.00]-24 660.9m ± 0% 140.6m ± 3% -78.73% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,75.00]-24 20.43µ ± 1% 15.46µ ± 1% -24.31% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,95.00]-24 18.03µ ± 1% 17.66µ ± 1% -2.01% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,99.00]-24 16.86µ ± 1% 16.70µ ± 1% -0.93% (p=0.011 n=10) RefreshRange/mixed-case/refresh_window=[75.00,75.00]-24 659.5m ± 1% 137.1m ± 3% -79.21% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[75.00,95.00]-24 17.96µ ± 1% 17.65µ ± 1% -1.77% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[75.00,99.00]-24 16.86µ ± 1% 16.66µ ± 1% -1.23% (p=0.008 n=10) RefreshRange/mixed-case/refresh_window=[95.00,95.00]-24 900.95µ ± 0% 32.18µ ± 0% -96.43% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[95.00,99.00]-24 14.35µ ± 1% 14.50µ ± 2% +1.03% (p=0.002 n=10) RefreshRange/mixed-case/refresh_window=[99.00,99.00]-24 227.235m ± 1% 3.361m ± 1% -98.52% (p=0.000 n=10) geomean 136.9µ 73.57µ -46.24% goos: linux goarch: amd64 cpu: Intel(R) Xeon(R) CPU @ 2.80GHz │ old2.txt │ new2.txt │ │ sec/op │ sec/op vs base │ MVCCIncrementalIterator/ts=5-24 24.93m ± 3% 24.53m ± 2% -1.61% (p=0.004 n=10) MVCCIncrementalIterator/ts=480-24 560.4µ ± 1% 453.8µ ± 0% -19.02% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=100-24 1.444m ± 0% 1.434m ± 0% -0.72% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=500-24 1.994m ± 0% 1.974m ± 1% -1.02% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=1000-24 2.672m ± 1% 2.649m ± 1% ~ (p=0.063 n=10) MVCCIncrementalIteratorForOldData/valueSize=2000-24 4.059m ± 1% 4.009m ± 1% -1.23% (p=0.011 n=10) geomean 2.754m 2.635m -4.33% ``` Epic: none Informs #66869 Close #98881 Release note: none 111566: cli/sql: better report the virtual cluster name in the prompt r=stevendanna a=knz First commit from #111565. Fixes #111491. Epic: CRDB-26691 Prior to this patch, the SQL shell was reporting the name of the virtual cluster using the `cluster:` option in the connection URL. This was brittle, as it didn't handle the case where the SQL connection was routed to a virtual cluster implicitly via the cluster setting `server.controller.default_target_cluster`. This commit makes the display more robust by having the server report the virtual cluster name via the `node_build_info` virtual table, alongside the cluster ID and organization which were already communicated in this way. (No release note because this is new functionality in 23.2) 111579: settings: tweak the comment guidance r=erikgrinaker a=knz Epic: CRDB-6671 As suggested by `@erikgrinaker` [here](#111378 (comment)) and discussed [here](https://cockroachlabs.slack.com/archives/C05N2J8ACQH/p1696255584272959). Release note: None Co-authored-by: Jackson Owens <[email protected]> Co-authored-by: Raphael 'kena' Poss <[email protected]>
Previously, the minimum and maximum timestamps used to configure a "time-bound" iterator were only hints. The iterator would surface keys outside those bounds frequently if the keys were contained within a sstable block that also contained keys within bounds. This commit adapts the iterator construction to use Pebble's IterOptions.SkipPoint option to filter out-of-range keys without yielding them to the caller. This adds a small additional overhead to processing KVs that are ultimately yielded to the user of a MVCCIncrementalIterator, but removes a large overhead to proessing KVs that are ultimately skipped. In the current MVCCIncrementalIterator implementation, keys that are outside the time range still reposition the iterator without time bound. This repositioning no longer happens, and removing this overhead more than reclaims the RefreshRange benchmark's regression from the introduction of value blocks that resulted in packing keys more densely. This also serves as a step towards cockroachdb#66869. ``` goos: linux goarch: amd64 cpu: Intel(R) Xeon(R) CPU @ 2.80GHz │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ RefreshRange/linear-keys/refresh_window=[0.00,0.00]-24 150.73µ ± 1% 55.75µ ± 1% -63.01% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[0.00,50.00]-24 16.52µ ± 1% 16.19µ ± 2% -2.00% (p=0.005 n=10) RefreshRange/linear-keys/refresh_window=[0.00,75.00]-24 13.94µ ± 1% 13.59µ ± 1% -2.55% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[0.00,95.00]-24 13.97µ ± 1% 13.56µ ± 3% -2.99% (p=0.002 n=10) RefreshRange/linear-keys/refresh_window=[0.00,99.00]-24 13.96µ ± 1% 13.45µ ± 3% -3.69% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,50.00]-24 149.95µ ± 1% 55.67µ ± 1% -62.88% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,75.00]-24 22.05µ ± 1% 21.70µ ± 0% -1.57% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,95.00]-24 22.08µ ± 1% 21.61µ ± 0% -2.14% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[50.00,99.00]-24 21.91µ ± 1% 21.69µ ± 1% -0.99% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,75.00]-24 139.27µ ± 1% 55.82µ ± 1% -59.92% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,95.00]-24 23.76µ ± 1% 23.36µ ± 0% -1.66% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[75.00,99.00]-24 23.85µ ± 1% 23.25µ ± 1% -2.48% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[95.00,95.00]-24 138.94µ ± 1% 55.52µ ± 0% -60.04% (p=0.000 n=10) RefreshRange/linear-keys/refresh_window=[95.00,99.00]-24 26.68µ ± 1% 26.30µ ± 1% -1.42% (p=0.005 n=10) RefreshRange/linear-keys/refresh_window=[99.00,99.00]-24 141.39µ ± 1% 55.02µ ± 1% -61.09% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[0.00,0.00]-24 322.35µ ± 0% 51.21µ ± 0% -84.11% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[0.00,50.00]-24 16.35µ ± 1% 16.63µ ± 2% ~ (p=0.105 n=10) RefreshRange/random-keys/refresh_window=[0.00,75.00]-24 17.42µ ± 1% 17.29µ ± 3% ~ (p=0.796 n=10) RefreshRange/random-keys/refresh_window=[0.00,95.00]-24 13.40µ ± 1% 13.45µ ± 1% ~ (p=0.529 n=10) RefreshRange/random-keys/refresh_window=[0.00,99.00]-24 13.59µ ± 2% 13.41µ ± 0% ~ (p=0.239 n=10) RefreshRange/random-keys/refresh_window=[50.00,50.00]-24 707.5m ± 1% 111.7m ± 1% -84.21% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,75.00]-24 21.94µ ± 1% 17.86µ ± 0% -18.59% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,95.00]-24 13.95µ ± 1% 13.54µ ± 1% -2.94% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[50.00,99.00]-24 13.96µ ± 0% 13.53µ ± 1% -3.06% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[75.00,75.00]-24 395.22m ± 0% 33.81m ± 1% -91.45% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[75.00,95.00]-24 19.42µ ± 1% 19.40µ ± 1% ~ (p=0.912 n=10) RefreshRange/random-keys/refresh_window=[75.00,99.00]-24 19.37µ ± 1% 19.42µ ± 1% ~ (p=0.247 n=10) RefreshRange/random-keys/refresh_window=[95.00,95.00]-24 546.66m ± 3% 48.48m ± 3% -91.13% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[95.00,99.00]-24 21.69µ ± 1% 19.68µ ± 1% -9.24% (p=0.000 n=10) RefreshRange/random-keys/refresh_window=[99.00,99.00]-24 546.27m ± 0% 48.73m ± 3% -91.08% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[0.00,0.00]-24 410.1µ ± 0% 221.1µ ± 1% -46.09% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[0.00,50.00]-24 14.84µ ± 1% 14.84µ ± 1% ~ (p=0.739 n=10) RefreshRange/mixed-case/refresh_window=[0.00,75.00]-24 14.84µ ± 1% 14.83µ ± 1% ~ (p=0.615 n=10) RefreshRange/mixed-case/refresh_window=[0.00,95.00]-24 17.39µ ± 2% 17.51µ ± 2% +0.68% (p=0.029 n=10) RefreshRange/mixed-case/refresh_window=[0.00,99.00]-24 16.41µ ± 1% 16.38µ ± 1% ~ (p=0.971 n=10) RefreshRange/mixed-case/refresh_window=[50.00,50.00]-24 660.9m ± 0% 140.6m ± 3% -78.73% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,75.00]-24 20.43µ ± 1% 15.46µ ± 1% -24.31% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,95.00]-24 18.03µ ± 1% 17.66µ ± 1% -2.01% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[50.00,99.00]-24 16.86µ ± 1% 16.70µ ± 1% -0.93% (p=0.011 n=10) RefreshRange/mixed-case/refresh_window=[75.00,75.00]-24 659.5m ± 1% 137.1m ± 3% -79.21% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[75.00,95.00]-24 17.96µ ± 1% 17.65µ ± 1% -1.77% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[75.00,99.00]-24 16.86µ ± 1% 16.66µ ± 1% -1.23% (p=0.008 n=10) RefreshRange/mixed-case/refresh_window=[95.00,95.00]-24 900.95µ ± 0% 32.18µ ± 0% -96.43% (p=0.000 n=10) RefreshRange/mixed-case/refresh_window=[95.00,99.00]-24 14.35µ ± 1% 14.50µ ± 2% +1.03% (p=0.002 n=10) RefreshRange/mixed-case/refresh_window=[99.00,99.00]-24 227.235m ± 1% 3.361m ± 1% -98.52% (p=0.000 n=10) geomean 136.9µ 73.57µ -46.24% goos: linux goarch: amd64 cpu: Intel(R) Xeon(R) CPU @ 2.80GHz │ old2.txt │ new2.txt │ │ sec/op │ sec/op vs base │ MVCCIncrementalIterator/ts=5-24 24.93m ± 3% 24.53m ± 2% -1.61% (p=0.004 n=10) MVCCIncrementalIterator/ts=480-24 560.4µ ± 1% 453.8µ ± 0% -19.02% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=100-24 1.444m ± 0% 1.434m ± 0% -0.72% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=500-24 1.994m ± 0% 1.974m ± 1% -1.02% (p=0.000 n=10) MVCCIncrementalIteratorForOldData/valueSize=1000-24 2.672m ± 1% 2.649m ± 1% ~ (p=0.063 n=10) MVCCIncrementalIteratorForOldData/valueSize=2000-24 4.059m ± 1% 4.009m ± 1% -1.23% (p=0.011 n=10) geomean 2.754m 2.635m -4.33% ``` Epic: none Informs cockroachdb#66869 Close cockroachdb#98881 Release note: none
See #98068 and https://docs.google.com/spreadsheets/d/10GhYr_91CANCNKOM_gPy7Sk9hQkTyQGNgNwNgfHeUtI/edit#gid=4.
Jira issue: CRDB-25565
The text was updated successfully, but these errors were encountered: