-
Notifications
You must be signed in to change notification settings - Fork 265
perf: Improve string to int perf #3017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Initial benchmarks showed improvement to match with Spark's performance. I will continue to profile the code to see if we can squeeze in additional optimization |
| cast_array.append_value(cast_value); | ||
| } else { | ||
| cast_array.append_null() | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made null check conditional to remove unwanted branching
| if len == 1 { | ||
| return none_or_err(eval_mode, type_name, str); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same (removed unwanted If branching)
| let mut parse_sign_and_digits = true; | ||
|
|
||
| for (i, ch) in trimmed_str.char_indices() { | ||
| for &ch in &trimmed_bytes[idx..] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaner and faster approach to access the chars directly
|
Results : |
|
Proceeding with some rather unsafe options to see if we can squeeze in further optimizations |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3017 +/- ##
============================================
+ Coverage 56.12% 59.56% +3.43%
- Complexity 976 1379 +403
============================================
Files 119 167 +48
Lines 11743 15496 +3753
Branches 2251 2569 +318
============================================
+ Hits 6591 9230 +2639
- Misses 4012 4968 +956
- Partials 1140 1298 +158 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Which issue does this PR close?
Closes #2981
Rationale for this change
What changes are included in this PR?
How are these changes tested?