Skip to content

Conversation

@AdamGS
Copy link
Contributor

@AdamGS AdamGS commented Jan 16, 2026

This PR removes some unnecessary work, relying on the previous assertion that the offsets array is sorted.

@AdamGS AdamGS added the performance Release label indicating an improvement to performance label Jan 16, 2026
if let Some(min) = min_max.min.as_primitive().as_::<P>() {
vortex_ensure!(
min >= 0 && min <= max_offset,
min >= 0,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

at this point we know min is lt_eq the last element, because the offsets array is sorted

);
}

if let Some(max) = min_max.max.as_primitive().as_::<P>() {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

max == max_offset, and if min is >=, so should it be for the same reasons

@robert3005
Copy link
Contributor

Because we check is_sorted this is indeed unnecessary

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.88%. Comparing base (12ba988) to head (47353a8).
⚠️ Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
vortex-array/src/arrays/list/array.rs 82.35% 3 Missing ⚠️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

// the elements array.
if let Some(min_max) = min_max(offsets)? {
match_each_integer_ptype!(offsets_ptype, |P| {
let max_offset = P::try_from(offsets.scalar_at(offsets.len() - 1))
Copy link
Contributor

Choose a reason for hiding this comment

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

dont do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

@AdamGS AdamGS force-pushed the adamg/optimize-list-validate branch from 3a5f61c to 47353a8 Compare January 16, 2026 16:25
@AdamGS AdamGS enabled auto-merge (squash) January 16, 2026 16:33
@AdamGS AdamGS disabled auto-merge January 16, 2026 16:34
@AdamGS AdamGS enabled auto-merge (squash) January 16, 2026 16:34
@AdamGS AdamGS disabled auto-merge January 16, 2026 16:36
@AdamGS AdamGS enabled auto-merge (squash) January 16, 2026 16:37
@AdamGS AdamGS disabled auto-merge January 16, 2026 16:37
@AdamGS AdamGS enabled auto-merge (squash) January 16, 2026 16:39
@AdamGS AdamGS merged commit 6fe029b into develop Jan 16, 2026
49 of 50 checks passed
@AdamGS AdamGS deleted the adamg/optimize-list-validate branch January 16, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Release label indicating an improvement to performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants