Skip to content

Compare DecimalByteParts decode at the canonical width - #11510

Merged
connortsui20 merged 1 commit into
developfrom
ct/dbp-bench-canonical-width
Nov 17, 2026
Merged

connortsui20 merged 1 commit into
developfrom
ct/dbp-bench-canonical-width

Conversation

@connortsui20

Copy link
Copy Markdown
Member

Summary

decode and filter currently stop at whatever storage width DecimalByteParts returns. That makes a decoder that returns narrow storage look faster than one that returns the canonical decimal width, even though the results have different physical layouts.

Changes

Both benchmarks now end at the canonical width, with a copy only when the decoded width differs. Names and cases stay the same so CodSpeed can compare the same workloads across the decoder change.

CodSpeed is expected to report slower decode and filter results on this PR because these benchmarks now include the widening copy that callers need. #11459 can then be compared against the same endpoint.

Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
@connortsui20
connortsui20 marked this pull request as ready for review November 16, 2026 20:44
@connortsui20
connortsui20 enabled stacked auto-merge (squash) November 16, 2026 20:47
@codspeed

codspeed Bot commented Nov 16, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 66.73%

2 warnings

⚠️ Walltime results may be unreliable

Some benchmarks used the Walltime instrument outside CodSpeed Macro Runners, which can make the results inconsistent.

Learn more about Macro Runners

See affected benchmarks

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

❌ 8 regressed benchmarks
✅ 1950 untouched benchmarks
⏩ 53 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ CPU Simulation decode[msp_i64_p38] 23.1 µs 262.5 µs -91.18%
❌ CPU Simulation decode[msp_i32_p18_nullable] 23.4 µs 130.5 µs -82.09%
❌ CPU Simulation decode[msp_i32_p18] 22.2 µs 121.3 µs -81.68%
❌ CPU Simulation decode[gap_msp_i16_p10] 22.2 µs 107.2 µs -79.26%
❌ CPU Simulation filter[msp_i64_p38] 158.5 µs 252.4 µs -37.19%
❌ CPU Simulation filter[gap_msp_i16_p10] 94.6 µs 134.4 µs -29.64%
❌ CPU Simulation filter[msp_i32_p18] 115.7 µs 159.9 µs -27.66%
❌ CPU Simulation filter[msp_i32_p18_nullable] 156.8 µs 200.3 µs -21.74%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ct/dbp-bench-canonical-width (b0391bc) with develop (c58d623)

Open in CodSpeed

Footnotes

  1. 53 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. ↩

Comment on lines +254 to +270
fn decode_at_canonical_width(array: ArrayRef, ctx: &mut ExecutionCtx) -> DecimalArray {
let decoded = array
.execute::<DecimalArray>(ctx)
.vortex_expect("decode DecimalByteParts");
let decimal_dtype = decoded.decimal_dtype();
let canonical_type = decimal_dtype.canonical_values_type();
if decoded.values_type() == canonical_type {
return decoded;
}

let validity = decoded.validity().vortex_expect("decimal validity");
let mask = validity
.execute_mask(decoded.len(), ctx)
.vortex_expect("execute decimal validity");
let values = match_each_decimal_value_type!(decoded.values_type(), |T| {
copy_to_canonical_width(decoded.buffer::<T>().as_ref(), &mask, decimal_dtype)
.vortex_expect("copy decoded values to the canonical width")

@joseph-isaacs joseph-isaacs Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who does this differ from execution::<Canonical> or CanonicalRec?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not have a single width per decimal precision now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet because we need to get DecimalByteParts canonicalization into the correct width first, which requires this entire stack

@joseph-isaacs joseph-isaacs Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so is this change undone at the end of the stack?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I will remove it in the next PR

@joseph-isaacs
joseph-isaacs disabled stacked auto-merge November 17, 2026 09:50
@connortsui20
connortsui20 merged commit a59dc52 into develop Nov 17, 2026
199 of 203 checks passed
@connortsui20
connortsui20 deleted the ct/dbp-bench-canonical-width branch November 17, 2026 14:52
@connortsui20 connortsui20 mentioned this pull request Nov 17, 2026
33 of 36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants