Skip to content

Avoid execution contexts for simple masked validity - #9713

Open
palaska wants to merge 1 commit into
developfrom
bp/masked-validity-fast-path
Open

Avoid execution contexts for simple masked validity#9713
palaska wants to merge 1 commit into
developfrom
bp/masked-validity-fast-path

Conversation

@palaska

@palaska palaska commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Avoid ExecutionCtx creation for non-array masked child validity.
  • Preserve exact validation for array-backed validity.
  • Cover all validity variants and empty arrays.

Tests

  • cargo nextest run -p vortex-array
  • cargo clippy -p vortex-array --all-targets --all-features
  • cargo +nightly fmt --all

Signed-off-by: Baris Palaska <barispalaska@gmail.com>
@palaska palaska added the changelog/performance A performance improvement label Sep 1, 2026
@codspeed-hq

codspeed-hq Bot commented Sep 1, 2026

Copy link
Copy Markdown

Merging this PR will regress 2 benchmarks

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 13 improved benchmarks
❌ 2 regressed benchmarks
✅ 2075 untouched benchmarks
⏩ 206 skipped benchmarks1
🗄️ 4 archived benchmarks run2

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime arrow_checked_add_u32_neon[16384] 12.4 µs 20.4 µs -39.26%
WallTime deferred_i64_avx2[PerRowPerRow] 9.9 µs 11.6 µs -14.24%
WallTime add_shapes_neon[(128, PerRowPerRow)] 3.7 µs 1.9 µs +98.01%
WallTime subtract_shapes_neon[(128, PerRowPerRow)] 2.9 µs 1.8 µs +56.03%
WallTime multiply_shapes_neon[(128, PerRowPerRow)] 2.9 µs 1.9 µs +51.21%
WallTime arrow_checked_add_u32_avx2[16384] 21.3 µs 17.7 µs +20.36%
WallTime arrow_checked_add_u32_avx512[16384] 21.3 µs 17.7 µs +20.28%
WallTime add_u32_nonnull_neon 7.9 µs 6.7 µs +18.53%
WallTime add_shapes_neon[(16384, PerRowPerRow)] 11.3 µs 9.8 µs +16.06%
WallTime compare_int_nullable_neon 5.6 µs 4.9 µs +15.91%
WallTime add_i32_nonnull_neon 9 µs 7.8 µs +14.87%
WallTime add_i64_nonnull_neon 11.3 µs 9.8 µs +14.74%
WallTime add_i64_nullable_neon 12.8 µs 11.3 µs +13.18%
WallTime compare_int_constant_neon 4.4 µs 4 µs +10.59%
WallTime add_constant_shapes_neon[(16384, PerRowNullableConstant)] 10.8 µs 9.8 µs +10.21%

Tip

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


Comparing bp/masked-validity-fast-path (e4a29cf) with develop (a67cd1b)

Open in CodSpeed

Footnotes

  1. 206 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.

  2. 4 benchmarks were run, but are now archived. If they were deleted in another branch, consider rebasing to remove them from the report. Instead if they were added back, click here to restore them.

Comment on lines +24 to +41
#[rstest]
#[case(Validity::NonNullable, true)]
#[case(Validity::AllValid, true)]
#[case(Validity::AllInvalid, false)]
#[case(Validity::from_iter([true, true, true]), true)]
#[case(Validity::from_iter([true, false, true]), false)]
fn test_child_all_valid(#[case] validity: Validity, #[case] expected: bool) -> VortexResult<()> {
let child = PrimitiveArray::new(vortex_buffer::buffer![1i32, 2, 3], validity).into_array();
assert_eq!(child_all_valid(&child)?, expected);
Ok(())
}

#[test]
fn test_empty_child_all_valid() -> VortexResult<()> {
let child = PrimitiveArray::new(Buffer::<i32>::empty(), Validity::AllInvalid).into_array();
assert!(child_all_valid(&child)?);
Ok(())
}

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.

was this not tested before?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants