Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GC improvements 6: introduce batched GC (#4400)
Makes the GC capable of dropping entire buckets in one go when the conditions are met (and they are pretty simple to meet in the common case of in-order data). Unfortunately, I couldn't make the batched GC match -- let alone improve -- the performance of the standard GC. I even have a branch with a parallel batched GC, and it's still slower: the overhead of the batching datastructures just kills me everytime. For that reason, batching is disabled by default. I still want to commit the code so as to prevent it from rotting though, so we can come back to it at a later time. This introduces a slight performance deterioration on the non-batched path, that's fine. ### Benchmarks Compared to `main`: ``` group gc_improvements_0 gc_improvements_6 ----- ----------------- ----------------- .../plotting_dashboard/drop_at_least=0.3/default 7.62 652.8±4.12ms 89.8 KElem/sec 1.00 85.7±1.14ms 683.8 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=256 5.34 465.8±2.50ms 125.8 KElem/sec 1.00 87.2±0.55ms 671.9 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=512 7.12 655.3±2.61ms 89.4 KElem/sec 1.00 92.0±1.85ms 636.8 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=1024 12.45 1084.0±4.47ms 54.1 KElem/sec 1.00 87.1±0.40ms 672.7 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=2048 23.63 2.1±0.02s 27.6 KElem/sec 1.00 89.9±1.13ms 652.0 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=256/gc_batching=true 1.00 98.6±0.82ms 594.2 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=512/gc_batching=true 1.00 94.6±1.26ms 619.3 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=1024/gc_batching=true 1.00 93.2±1.29ms 628.9 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=2048/gc_batching=true 1.00 94.3±1.43ms 621.1 KElem/sec .../timeless_logs/drop_at_least=0.3/default 33.30 2.4±0.03s 24.4 KElem/sec 1.00 72.2±2.46ms 811.4 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=256 35.16 2.5±0.08s 23.5 KElem/sec 1.00 71.1±2.31ms 824.5 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=512 35.08 2.4±0.02s 24.5 KElem/sec 1.00 68.1±1.20ms 859.9 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=1024 36.86 2.4±0.05s 24.2 KElem/sec 1.00 65.7±0.87ms 891.4 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=2048 35.99 2.4±0.03s 24.1 KElem/sec 1.00 67.7±1.33ms 865.9 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=256/gc_batching=true 1.00 68.7±1.40ms 853.1 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=512/gc_batching=true 1.00 67.3±0.32ms 870.8 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=1024/gc_batching=true 1.00 67.7±1.21ms 865.2 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=2048/gc_batching=true 1.00 67.6±1.31ms 866.6 KElem/sec ``` Compared to previous PR: ``` group gc_improvements_5 gc_improvements_6 ----- ----------------- ----------------- .../plotting_dashboard/drop_at_least=0.3/default 1.00 81.4±0.94ms 720.0 KElem/sec 1.05 85.7±1.14ms 683.8 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=256 1.00 84.0±0.50ms 697.8 KElem/sec 1.04 87.2±0.55ms 671.9 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=512 1.00 82.5±1.33ms 710.0 KElem/sec 1.11 92.0±1.85ms 636.8 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=1024 1.00 83.4±1.16ms 702.9 KElem/sec 1.04 87.1±0.40ms 672.7 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=2048 1.00 83.7±0.61ms 700.0 KElem/sec 1.07 89.9±1.13ms 652.0 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=256/gc_batching=true 1.00 98.6±0.82ms 594.2 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=512/gc_batching=true 1.00 94.6±1.26ms 619.3 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=1024/gc_batching=true 1.00 93.2±1.29ms 628.9 KElem/sec .../plotting_dashboard/drop_at_least=0.3/bucketsz=2048/gc_batching=true 1.00 94.3±1.43ms 621.1 KElem/sec .../timeless_logs/drop_at_least=0.3/default 1.00 66.8±0.85ms 877.3 KElem/sec 1.08 72.2±2.46ms 811.4 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=256 1.00 67.5±1.43ms 868.2 KElem/sec 1.05 71.1±2.31ms 824.5 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=512 1.00 67.4±1.40ms 869.4 KElem/sec 1.01 68.1±1.20ms 859.9 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=1024 1.03 67.5±2.21ms 867.5 KElem/sec 1.00 65.7±0.87ms 891.4 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=2048 1.00 67.8±1.86ms 863.9 KElem/sec 1.00 67.7±1.33ms 865.9 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=1024/gc_batching=true 1.00 67.7±1.21ms 865.2 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=2048/gc_batching=true 1.00 67.6±1.31ms 866.6 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=256/gc_batching=true 1.00 68.7±1.40ms 853.1 KElem/sec .../timeless_logs/drop_at_least=0.3/bucketsz=512/gc_batching=true 1.00 67.3±0.32ms 870.8 KElem/sec ``` --- Part of the GC improvements series: - #4394 - #4395 - #4396 - #4397 - #4398 - #4399 - #4400 - #4401
- Loading branch information