Skip to content

Conversation

@andygrove
Copy link
Member

@andygrove andygrove commented Dec 27, 2025

Which issue does this PR close?

N/A

Rationale for this change

Avoid some allocations.

Scenario Before After Speedup
No special values 20.2 µs 3.7 µs 5.4x
10% NaN 20.3 µs 3.7 µs 5.5x
10% neg zero 21.2 µs 3.7 µs 5.7x
10% null 22.0 µs 3.6 µs 6.1x
Mixed 10% 25.4 µs 3.8 µs 6.7x
All normal 20.3 µs 3.8 µs 5.3x

What changes are included in this PR?

How are these changes tested?

@andygrove andygrove marked this pull request as ready for review December 27, 2025 17:08
@codecov-commenter
Copy link

codecov-commenter commented Dec 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.58%. Comparing base (f09f8af) to head (d774b1a).
⚠️ Report is 803 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2999      +/-   ##
============================================
+ Coverage     56.12%   59.58%   +3.46%     
- Complexity      976     1377     +401     
============================================
  Files           119      167      +48     
  Lines         11743    15493    +3750     
  Branches       2251     2569     +318     
============================================
+ Hits           6591     9232    +2641     
- Misses         4012     4962     +950     
- Partials       1140     1299     +159     

☔ 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.

@andygrove andygrove requested a review from comphead January 2, 2026 15:22
@sqlbenchmark
Copy link

Comet TPC-H Benchmark Results

Commit: d774b1a - revert
Scale Factor: SF100
Iterations: 1

Query Times

Query Time (s) Query Time (s)
Q1 10.67 Q12 7.19
Q2 5.85 Q13 6.85
Q3 9.56 Q14 3.65
Q4 11.25 Q15 7.19
Q5 18.62 Q16 4.49
Q6 2.61 Q17 31.91
Q7 11.82 Q18 33.28
Q8 24.43 Q19 6.90
Q9 37.54 Q20 6.58
Q10 10.44 Q21 45.59
Q11 4.36 Q22 4.93

Total Time: 305.71 seconds


Automated benchmark run by dfbench

Ok(ColumnarValue::Array(Arc::new(new_array)))
let input = as_primitive_array::<Float32Type>(&array);
// Use unary which operates directly on values buffer without intermediate allocation
let result: Float32Array = unary(input, normalize_float);
Copy link
Contributor

@comphead comphead Jan 2, 2026

Choose a reason for hiding this comment

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

👍 unary is fast but it requires the operation to be infallible and this is the case here.

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

Thanks @andygrove

@andygrove andygrove merged commit 6ec70ae into apache:main Jan 2, 2026
120 checks passed
@andygrove andygrove deleted the faster-normalize-nan branch January 2, 2026 17:56
@andygrove
Copy link
Member Author

Thanks for the review @comphead

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants