Reduce monomorphization by dispatching over unsigned integer widths#8110
Reduce monomorphization by dispatching over unsigned integer widths#8110joseph-isaacs wants to merge 1 commit into
Conversation
Polar Signals Profiling ResultsLatest Run
Powered by Polar Signals Cloud |
Benchmarks: PolarSignals ProfilingVortex (geomean): 1.031x ➖ datafusion / vortex-file-compressed (1.031x ➖, 0↑ 1↓)
|
File Sizes: PolarSignals ProfilingNo file size changes detected. |
Benchmarks: FineWeb NVMeVerdict: No clear signal (low confidence) datafusion / vortex-file-compressed (0.983x ➖, 0↑ 0↓)
datafusion / vortex-compact (0.991x ➖, 1↑ 1↓)
datafusion / parquet (1.004x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (1.024x ➖, 0↑ 1↓)
duckdb / vortex-compact (1.029x ➖, 0↑ 0↓)
duckdb / parquet (1.042x ➖, 0↑ 1↓)
Full attributed analysis
|
File Sizes: FineWeb NVMeNo file size changes detected. |
Benchmarks: TPC-H SF=1 on NVMEVerdict: No clear signal (low confidence) datafusion / vortex-file-compressed (1.003x ➖, 0↑ 0↓)
datafusion / vortex-compact (0.999x ➖, 0↑ 0↓)
datafusion / parquet (0.991x ➖, 0↑ 0↓)
datafusion / arrow (0.995x ➖, 0↑ 1↓)
duckdb / vortex-file-compressed (0.987x ➖, 0↑ 0↓)
duckdb / vortex-compact (0.990x ➖, 0↑ 0↓)
duckdb / parquet (1.010x ➖, 1↑ 2↓)
duckdb / duckdb (0.984x ➖, 0↑ 0↓)
Full attributed analysis
|
File Sizes: TPC-H SF=1 on NVMENo file size changes detected. |
Merging this PR will not alter performance
|
Benchmarks: TPC-DS SF=1 on NVMEVerdict: No clear signal (low confidence) datafusion / vortex-file-compressed (0.938x ➖, 10↑ 0↓)
datafusion / vortex-compact (0.943x ➖, 8↑ 0↓)
datafusion / parquet (0.941x ➖, 9↑ 0↓)
duckdb / vortex-file-compressed (0.947x ➖, 8↑ 0↓)
duckdb / vortex-compact (0.950x ➖, 8↑ 0↓)
duckdb / parquet (0.971x ➖, 0↑ 2↓)
duckdb / duckdb (0.955x ➖, 7↑ 2↓)
Full attributed analysis
|
File Sizes: TPC-DS SF=1 on NVMENo file size changes detected. |
Benchmarks: FineWeb S3Verdict: No clear signal (environment too noisy confidence) datafusion / vortex-file-compressed (1.071x ➖, 0↑ 0↓)
datafusion / vortex-compact (0.906x ➖, 0↑ 0↓)
datafusion / parquet (0.963x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (0.961x ➖, 0↑ 0↓)
duckdb / vortex-compact (0.850x ➖, 2↑ 0↓)
duckdb / parquet (0.970x ➖, 0↑ 0↓)
Full attributed analysis
|
Benchmarks: Statistical and Population GeneticsVerdict: No clear signal (low confidence) duckdb / vortex-file-compressed (0.994x ➖, 0↑ 0↓)
duckdb / vortex-compact (0.993x ➖, 0↑ 0↓)
duckdb / parquet (0.999x ➖, 0↑ 0↓)
Full attributed analysis
|
File Sizes: Statistical and Population GeneticsNo file size changes detected. |
Benchmarks: Random AccessVortex (geomean): 0.910x ➖ unknown / unknown (0.935x ➖, 8↑ 0↓)
|
Benchmarks: TPC-H SF=10 on NVMEVerdict: No clear signal (low confidence) datafusion / vortex-file-compressed (0.933x ➖, 6↑ 0↓)
datafusion / vortex-compact (0.975x ➖, 3↑ 0↓)
datafusion / parquet (0.972x ➖, 3↑ 0↓)
datafusion / arrow (0.987x ➖, 1↑ 0↓)
duckdb / vortex-file-compressed (0.948x ➖, 5↑ 0↓)
duckdb / vortex-compact (0.951x ➖, 5↑ 0↓)
duckdb / parquet (1.005x ➖, 0↑ 0↓)
duckdb / duckdb (0.969x ➖, 4↑ 0↓)
Full attributed analysis
|
File Sizes: TPC-H SF=10 on NVMENo file size changes detected. |
Benchmarks: Clickbench on NVMEVerdict: No clear signal (low confidence) datafusion / vortex-file-compressed (0.924x ➖, 10↑ 0↓)
datafusion / parquet (0.926x ➖, 8↑ 0↓)
duckdb / vortex-file-compressed (0.931x ➖, 8↑ 0↓)
duckdb / parquet (0.966x ➖, 0↑ 0↓)
duckdb / duckdb (0.973x ➖, 1↑ 0↓)
Full attributed analysis
|
File Sizes: Clickbench on NVMEFile Size Changes (1 files changed, -0.0% overall, 0↑ 1↓)
Totals:
|
Benchmarks: TPC-H SF=1 on S3Verdict: No clear signal (environment too noisy confidence) datafusion / vortex-file-compressed (1.087x ➖, 2↑ 8↓)
datafusion / vortex-compact (0.996x ➖, 2↑ 3↓)
datafusion / parquet (1.056x ➖, 2↑ 8↓)
duckdb / vortex-file-compressed (0.963x ➖, 0↑ 1↓)
duckdb / vortex-compact (0.991x ➖, 0↑ 1↓)
duckdb / parquet (0.984x ➖, 0↑ 0↓)
Full attributed analysis
|
Benchmarks: CompressionVortex (geomean): 1.000x ➖ unknown / unknown (0.957x ➖, 24↑ 3↓)
|
Benchmarks: TPC-H SF=10 on S3Verdict: No clear signal (environment too noisy confidence) datafusion / vortex-file-compressed (0.873x ➖, 3↑ 0↓)
datafusion / vortex-compact (0.943x ➖, 1↑ 1↓)
datafusion / parquet (0.971x ➖, 2↑ 3↓)
duckdb / vortex-file-compressed (0.944x ➖, 0↑ 0↓)
duckdb / vortex-compact (0.999x ➖, 0↑ 0↓)
duckdb / parquet (0.974x ➖, 0↑ 0↓)
Full attributed analysis
|
6a69131 to
7f43674
Compare
7f43674 to
2f132a9
Compare
Summary
This PR reduces code bloat from generic monomorphization by dispatching over unsigned integer widths (4 types) instead of all signed and unsigned integer types (8 types) in hot paths where values are known to be non-negative.
The key insight is that offsets, indices, lengths, and similar values are always non-negative. By reinterpreting signed buffers as their unsigned counterparts (same width, identical bit patterns), we can dispatch over 4 unsigned widths instead of 8 integer types. For nested matches (e.g., offset type × size type), this reduces the cross-product from 8×8=64 to 4×4=16 monomorphizations.