Pass execution context through list view rebuild#8274
Conversation
9514a28 to
d85c62e
Compare
Merging this PR will improve performance by 23.88%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | decompress_rd[f64, (100000, 0.01)] |
669.1 µs | 981.2 µs | -31.8% |
| ❌ | Simulation | decompress_rd[f64, (100000, 0.1)] |
669.1 µs | 981.1 µs | -31.8% |
| ❌ | Simulation | decompress_rd[f32, (100000, 0.1)] |
413.4 µs | 543.9 µs | -24% |
| ❌ | Simulation | decompress_rd[f32, (100000, 0.01)] |
413.4 µs | 543.9 µs | -23.99% |
| ❌ | Simulation | compare[1] |
59.3 µs | 67.1 µs | -11.75% |
| ❌ | Simulation | compare[6] |
71.3 µs | 80.5 µs | -11.45% |
| ❌ | Simulation | patched_take_10k_adversarial |
260 µs | 289 µs | -10.03% |
| ⚡ | Simulation | dict_canonicalize_zipfian[16, 1000] |
50.5 µs | 23.6 µs | ×2.1 |
| ⚡ | Simulation | compare[56] |
327.4 µs | 224.7 µs | +45.73% |
| ⚡ | Simulation | compare[62] |
363.8 µs | 249.9 µs | +45.56% |
| ⚡ | Simulation | compare[63] |
371.2 µs | 255.4 µs | +45.31% |
| ⚡ | Simulation | compare[60] |
353.8 µs | 243.6 µs | +45.25% |
| ⚡ | Simulation | compare[61] |
362.6 µs | 250.7 µs | +44.67% |
| ⚡ | Simulation | compare[58] |
347.2 µs | 240.8 µs | +44.17% |
| ⚡ | Simulation | compare[59] |
354.3 µs | 246.1 µs | +43.95% |
| ⚡ | Simulation | compare[57] |
345.8 µs | 241.3 µs | +43.32% |
| ⚡ | Simulation | compare[54] |
330.4 µs | 231.4 µs | +42.77% |
| ⚡ | Simulation | compare[55] |
337.1 µs | 236.4 µs | +42.61% |
| ⚡ | Simulation | compare[52] |
320.4 µs | 225.1 µs | +42.33% |
| ⚡ | Simulation | compare[48] |
295.4 µs | 207.5 µs | +42.33% |
| ... | ... | ... | ... | ... | ... |
ℹ️ 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 ct/rebuild-execute (01701be) with develop (5e3aedb)
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
d85c62e to
03c6d2f
Compare
Polar Signals Profiling ResultsLatest Run
Powered by Polar Signals Cloud |
Benchmarks: PolarSignals ProfilingVortex (geomean): 1.102x ❌ How to read Verdict and Engines
datafusion / vortex-file-compressed (1.102x ❌, 0↑ 6↓)
No file size changes detected. |
Benchmarks: FineWeb 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↓)
duckdb / vortex-file-compressed (0.973x ➖, 1↑ 0↓)
duckdb / vortex-compact (1.013x ➖, 0↑ 0↓)
duckdb / parquet (1.018x ➖, 0↑ 0↓)
File Size Changes (1 files changed, -0.0% overall, 0↑ 1↓)
Totals:
|
Benchmarks: TPC-H SF=1 on NVMEVerdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.178x ❌, 0↑ 22↓)
datafusion / vortex-compact (1.154x ❌, 0↑ 21↓)
datafusion / parquet (1.088x ➖, 0↑ 10↓)
datafusion / arrow (1.172x ❌, 0↑ 18↓)
duckdb / vortex-file-compressed (1.117x ❌, 0↑ 18↓)
duckdb / vortex-compact (1.106x ❌, 0↑ 14↓)
duckdb / parquet (1.071x ➖, 0↑ 5↓)
duckdb / duckdb (1.077x ➖, 0↑ 5↓)
File Size Changes (9 files changed, +0.0% overall, 5↑ 4↓)
Totals:
|
Benchmarks: TPC-DS SF=1 on NVMEVerdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (0.995x ➖, 0↑ 1↓)
datafusion / vortex-compact (0.997x ➖, 1↑ 1↓)
datafusion / parquet (1.002x ➖, 1↑ 1↓)
duckdb / vortex-file-compressed (1.001x ➖, 1↑ 2↓)
duckdb / vortex-compact (1.000x ➖, 1↑ 0↓)
duckdb / parquet (1.004x ➖, 1↑ 1↓)
duckdb / duckdb (0.994x ➖, 0↑ 0↓)
File Size Changes (5 files changed, -0.0% overall, 1↑ 4↓)
Totals:
|
Benchmarks: FineWeb S3Verdict: No clear signal (environment too noisy confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.183x ➖, 0↑ 1↓)
datafusion / vortex-compact (1.077x ➖, 0↑ 1↓)
datafusion / parquet (1.288x ➖, 0↑ 4↓)
duckdb / vortex-file-compressed (1.071x ➖, 0↑ 0↓)
duckdb / vortex-compact (1.056x ➖, 0↑ 0↓)
duckdb / parquet (1.090x ➖, 0↑ 0↓)
|
Benchmarks: Statistical and Population GeneticsVerdict: No clear signal (low confidence) How to read Verdict and Engines
duckdb / vortex-file-compressed (0.997x ➖, 0↑ 1↓)
duckdb / vortex-compact (1.008x ➖, 0↑ 0↓)
duckdb / parquet (1.000x ➖, 0↑ 0↓)
File Size Changes (1 files changed, -0.0% overall, 0↑ 1↓)
Totals:
|
Benchmarks: Random AccessVortex (geomean): 0.931x ➖ How to read Verdict and Engines
unknown / unknown (1.002x ➖, 12↑ 4↓)
|
Benchmarks: TPC-H SF=10 on NVMEVerdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.000x ➖, 0↑ 0↓)
datafusion / vortex-compact (0.992x ➖, 0↑ 0↓)
datafusion / parquet (0.995x ➖, 1↑ 0↓)
datafusion / arrow (0.999x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (0.991x ➖, 0↑ 0↓)
duckdb / vortex-compact (0.999x ➖, 0↑ 0↓)
duckdb / parquet (0.998x ➖, 1↑ 0↓)
duckdb / duckdb (0.998x ➖, 0↑ 0↓)
File Size Changes (26 files changed, +0.0% overall, 14↑ 12↓)
Totals:
|
Benchmarks: Clickbench on NVMEVerdict: No clear signal (environment too noisy confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.029x ➖, 2↑ 4↓)
datafusion / parquet (1.036x ➖, 1↑ 1↓)
duckdb / vortex-file-compressed (1.063x ➖, 1↑ 8↓)
duckdb / parquet (1.002x ➖, 1↑ 0↓)
duckdb / duckdb (1.014x ➖, 1↑ 0↓)
File Size Changes (104 files changed, +0.0% overall, 53↑ 51↓)
Totals:
|
|
I dont trust codspeed here |
Benchmarks: Appian on NVMEVerdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.092x ➖, 0↑ 2↓)
datafusion / parquet (1.079x ➖, 0↑ 2↓)
duckdb / vortex-file-compressed (1.063x ➖, 0↑ 1↓)
duckdb / parquet (1.051x ➖, 0↑ 0↓)
duckdb / duckdb (1.048x ➖, 0↑ 0↓)
File Size Changes (4 files changed, -0.0% overall, 0↑ 4↓)
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 (1.151x ➖, 0↑ 4↓)
datafusion / vortex-compact (1.102x ➖, 0↑ 3↓)
datafusion / parquet (1.083x ➖, 0↑ 3↓)
duckdb / vortex-file-compressed (1.133x ➖, 0↑ 3↓)
duckdb / vortex-compact (1.105x ➖, 0↑ 1↓)
duckdb / parquet (1.070x ➖, 0↑ 0↓)
|
Benchmarks: CompressionVortex (geomean): 1.000x ➖ How to read Verdict and Engines
unknown / unknown (1.011x ➖, 0↑ 1↓)
|
Benchmarks: TPC-H SF=10 on S3Verdict: No clear signal (environment too noisy confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.084x ➖, 0↑ 4↓)
datafusion / vortex-compact (1.158x ➖, 0↑ 2↓)
datafusion / parquet (1.035x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (1.105x ➖, 0↑ 0↓)
duckdb / vortex-compact (1.165x ➖, 0↑ 4↓)
duckdb / parquet (1.118x ➖, 0↑ 1↓)
|
Hoist `create_execution_ctx()` out of the divan-timed closures into the untimed `with_inputs` setup (using `bench_values` / `bench_local_values` where a by-value context is needed) so the benchmarks measure the operation under test rather than per-sample context creation. Replace every non-CUDA benchmark use of the deprecated global `LEGACY_SESSION` with a local `static SESSION` built from `VortexSession::empty().with::<ArraySession>()`, which is exactly what `LEGACY_SESSION` is defined as, so the change is behavior-preserving while reducing reliance on the legacy global. Document why `ListViewBuilder::extend_from_array_unchecked` still mints a `LEGACY_SESSION` context: the `ArrayBuilder` trait does not thread an `ExecutionCtx` through its extend methods. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
| /// will not have any leading or trailing garbage data. | ||
| /// The output `ListViewArray` will be zero-copyable back to a `ListArray`, and additionally it will | ||
| /// not have any leading or trailing garbage data. | ||
| pub fn list_view_from_list(list: ListArray, ctx: &mut ExecutionCtx) -> VortexResult<ListViewArray> { |
There was a problem hiding this comment.
Also should this be a method on the ListArray?
There was a problem hiding this comment.
I wanted it standalone since it is unclear if this should live on list view or list
| .offsets() | ||
| .clone() | ||
| .execute::<PrimitiveArray>(&mut ctx) | ||
| .vortex_expect("failed to execute list view offsets into a PrimitiveArray"); |
There was a problem hiding this comment.
probably, but not much we can do about it because of the builders API
Summary
TODO is there a tracking issue for deprecating the old to_canonical path? This PR makes a solid amount of progress in removing deprecated stuff.
Threads
ExecutionCtxthroughListView::rebuildand the paths it reaches (reset_offsets,compact,list_from_list_view,recursive_list_from_list_view) so they reuse the caller's session instead of each minting a freshLEGACY_SESSIONcontext internally.reset_offsetsinlist_view_from_listnow propagates with?instead ofvortex_expectsince execution can fail once it runs through it (#8274 (comment))API Changes
A few places that now get an
ExecutionCtxpassed through them.Testing
Tests and benchmarks also now use a local empty session. This is just a lot of mechanical / not semantic changes.