Optimize buffer ops#8322
Conversation
Merging this PR will improve performance by 13.94%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | chunked_dict_primitive_into_canonical[u32, (1000, 10, 10)] |
120.7 µs | 180.7 µs | -33.2% |
| ❌ | Simulation | encode_varbin[(1000, 2)] |
176.1 µs | 234.6 µs | -24.95% |
| ❌ | Simulation | bitwise_not_vortex_buffer_mut[128] |
186.1 ns | 244.4 ns | -23.86% |
| ❌ | Simulation | bitwise_not_vortex_buffer_mut[1024] |
246.4 ns | 304.7 ns | -19.14% |
| ❌ | Simulation | decompress_rd[f64, (100000, 0.0)] |
845.5 µs | 1,025.5 µs | -17.55% |
| ❌ | Simulation | chunked_varbinview_into_canonical[(1000, 10)] |
177.1 µs | 213.9 µs | -17.21% |
| ❌ | Simulation | bench_many_codes_few_values[1024] |
393.2 µs | 467.5 µs | -15.87% |
| ❌ | Simulation | decompress_rd[f32, (100000, 0.0)] |
499.1 µs | 587.7 µs | -15.06% |
| ❌ | Simulation | varbinview_large |
112.2 µs | 130.9 µs | -14.33% |
| ❌ | Simulation | bitwise_not_vortex_buffer_mut[2048] |
369.4 ns | 427.8 ns | -13.64% |
| ❌ | Simulation | set_indices_arrow_buffer[128] |
951.9 ns | 1,068.6 ns | -10.92% |
| ❌ | Simulation | map_new_output[128] |
731.1 ns | 818.6 ns | -10.69% |
| ⚡ | Simulation | slice_empty_vortex |
2,628.6 ns | 368.3 ns | ×7.1 |
| ⚡ | Simulation | sum_i32_nullable_all_valid |
69.2 µs | 35.2 µs | +96.74% |
| ⚡ | Simulation | slice_vortex_buffer[1024] |
1,305.8 ns | 871.4 ns | +49.86% |
| ⚡ | Simulation | slice_vortex_buffer[16384] |
1,305.8 ns | 871.4 ns | +49.86% |
| ⚡ | Simulation | slice_vortex_buffer[2048] |
1,305.8 ns | 871.4 ns | +49.86% |
| ⚡ | Simulation | slice_vortex_buffer[128] |
1,305.8 ns | 871.4 ns | +49.86% |
| ⚡ | Simulation | slice_vortex_buffer[65536] |
1,305.8 ns | 871.4 ns | +49.86% |
| ⚡ | Simulation | null_count_run_end[(10000, 4, 0.01)] |
125.4 µs | 91.7 µs | +36.74% |
| ... | ... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing adamg/buffer-slice-fast (4430546) with develop (679e2c5)2
Footnotes
-
23 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
develop(cb82828) during the generation of this report, so 679e2c5 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
## Summary Adds a basic benchmark for slicing, including an Arrow baseline. Hopefully building up to #8322, but I want a baseline first. Signed-off-by: Adam Gutglick <adam@spiraldb.com>
fd451bf to
341039a
Compare
Polar Signals Profiling ResultsLatest Run
Previous Runs (2)
Powered by Polar Signals Cloud |
Benchmarks: PolarSignals ProfilingVortex (geomean): 1.090x ➖ How to read Verdict and Engines
datafusion / vortex-file-compressed (1.090x ➖, 0↑ 4↓)
No file size changes detected. |
Benchmarks: FineWeb NVMeVerdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.112x ❌, 0↑ 6↓)
datafusion / vortex-compact (1.080x ➖, 0↑ 2↓)
datafusion / parquet (1.121x ❌, 0↑ 5↓)
duckdb / vortex-file-compressed (1.141x ❌, 0↑ 8↓)
duckdb / vortex-compact (1.083x ➖, 0↑ 4↓)
duckdb / parquet (1.102x ❌, 0↑ 3↓)
File Size Changes (1 files changed, +0.0% overall, 1↑ 0↓)
Totals:
|
Benchmarks: TPC-H SF=1 on NVMEVerdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.062x ➖, 0↑ 2↓)
datafusion / vortex-compact (0.932x ➖, 10↑ 0↓)
datafusion / parquet (1.041x ➖, 1↑ 4↓)
datafusion / arrow (0.960x ➖, 4↑ 3↓)
duckdb / vortex-file-compressed (1.041x ➖, 0↑ 6↓)
duckdb / vortex-compact (1.000x ➖, 1↑ 0↓)
duckdb / parquet (0.990x ➖, 0↑ 0↓)
duckdb / duckdb (1.006x ➖, 0↑ 0↓)
File Size Changes (9 files changed, +0.2% overall, 9↑ 0↓)
Totals:
|
Benchmarks: TPC-DS SF=1 on NVMEVerdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (0.991x ➖, 6↑ 1↓)
datafusion / vortex-compact (1.003x ➖, 0↑ 2↓)
datafusion / parquet (0.996x ➖, 3↑ 0↓)
duckdb / vortex-file-compressed (0.994x ➖, 2↑ 1↓)
duckdb / vortex-compact (0.994x ➖, 0↑ 1↓)
duckdb / parquet (0.999x ➖, 1↑ 1↓)
duckdb / duckdb (0.997x ➖, 0↑ 3↓)
File Size Changes (7 files changed, +0.0% overall, 7↑ 0↓)
Totals:
|
Benchmarks: Statistical and Population GeneticsVerdict: No clear signal (low confidence) How to read Verdict and Engines
duckdb / vortex-file-compressed (1.022x ➖, 0↑ 0↓)
duckdb / vortex-compact (1.020x ➖, 0↑ 0↓)
duckdb / parquet (1.025x ➖, 0↑ 0↓)
File Size Changes (1 files changed, +0.0% overall, 1↑ 0↓)
Totals:
|
Benchmarks: FineWeb S3Verdict: No clear signal (environment too noisy confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (0.971x ➖, 1↑ 1↓)
datafusion / vortex-compact (1.014x ➖, 2↑ 1↓)
datafusion / parquet (0.920x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (0.853x ➖, 2↑ 0↓)
duckdb / vortex-compact (0.968x ➖, 0↑ 1↓)
duckdb / parquet (0.972x ➖, 0↑ 0↓)
|
BENCHMARK FAILEDBenchmark |
Benchmarks: TPC-H SF=10 on NVMEVerdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (0.993x ➖, 0↑ 0↓)
datafusion / vortex-compact (1.006x ➖, 0↑ 0↓)
datafusion / parquet (0.997x ➖, 0↑ 0↓)
datafusion / arrow (0.926x ➖, 7↑ 0↓)
duckdb / vortex-file-compressed (1.002x ➖, 0↑ 0↓)
duckdb / vortex-compact (1.003x ➖, 0↑ 0↓)
duckdb / parquet (1.000x ➖, 0↑ 0↓)
duckdb / duckdb (0.998x ➖, 0↑ 0↓)
File Size Changes (26 files changed, -0.0% overall, 8↑ 18↓)
Totals:
|
Benchmarks: Clickbench on NVMEVerdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (0.969x ➖, 13↑ 2↓)
datafusion / parquet (0.913x ➖, 13↑ 0↓)
duckdb / vortex-file-compressed (1.011x ➖, 4↑ 0↓)
duckdb / parquet (1.002x ➖, 0↑ 0↓)
duckdb / duckdb (1.013x ➖, 0↑ 1↓)
File Size Changes (107 files changed, -0.0% overall, 56↑ 51↓)
Totals:
|
Benchmarks: TPC-H SF=1 on S3Verdict: No clear signal (environment too noisy confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (0.873x ➖, 3↑ 0↓)
datafusion / vortex-compact (0.867x ➖, 5↑ 0↓)
datafusion / parquet (1.267x ➖, 1↑ 13↓)
duckdb / vortex-file-compressed (0.875x ➖, 1↑ 0↓)
duckdb / vortex-compact (0.933x ➖, 0↑ 0↓)
duckdb / parquet (0.917x ➖, 0↑ 0↓)
|
Benchmarks: Appian on NVMEVerdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.008x ➖, 0↑ 0↓)
datafusion / parquet (1.007x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (1.031x ➖, 0↑ 0↓)
duckdb / parquet (1.006x ➖, 0↑ 0↓)
duckdb / duckdb (1.007x ➖, 0↑ 0↓)
File Size Changes (4 files changed, -0.0% overall, 1↑ 3↓)
Totals:
|
Benchmarks: CompressionVortex (geomean): 1.016x ➖ How to read Verdict and Engines
unknown / unknown (1.045x ➖, 2↑ 29↓)
|
Benchmarks: TPC-H SF=10 on S3Verdict: No clear signal (environment too noisy confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (0.870x ➖, 4↑ 1↓)
datafusion / vortex-compact (0.867x ➖, 3↑ 0↓)
datafusion / parquet (1.044x ➖, 0↑ 4↓)
duckdb / vortex-file-compressed (0.929x ➖, 0↑ 0↓)
duckdb / vortex-compact (1.065x ➖, 0↑ 2↓)
duckdb / parquet (0.921x ➖, 0↑ 0↓)
|
|
I made #8162 that optimizes some of these code paths |
06ac2f8 to
dde48e4
Compare
|
@robert3005 do you want to merge that first? |
|
that would be ideal, the pr I made is a revival of an older pr already |
|
I'll review it |
dde48e4 to
ae9bc12
Compare
d4f17f3 to
64fb797
Compare
be356c3 to
11bb86c
Compare
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
975ba61 to
58e5bec
Compare
Signed-off-by: Adam Gutglick <adam@spiraldb.com>
58e5bec to
19e9dc3
Compare
Summary
This PR includes a few optimization for buffer-level ops:
Alignment, instead of having less specific checks in different callsites.After this PR is merged, I'll follow up and try to remove
bitvecas a dependency, its currently used in a couple of pretty random places and I suspect there's nothing special about them compared to our ownBitBuffer.