tustvold commented on code in PR #1577:
URL: https://github.com/apache/arrow-rs/pull/1577#discussion_r851737222
##########
arrow/src/compute/kernels/substring.rs:
##########
@@ -59,13 +78,14 @@ fn generic_substring<OffsetSize: StringOffsetSizeTrait>(
let mut len_so_far = zero;
new_offsets.push(zero);
- offsets.windows(2).for_each(|pair| {
- let new_start = cal_new_start(pair[0], pair[1]);
- let new_length = cal_new_length(new_start, pair[1]);
- len_so_far += new_length;
- new_starts_ends.push((new_start, new_start + new_length));
+ offsets.windows(2).try_for_each(|pair| -> Result<()> {
Review Comment:
I'm curious if the dyn dispatch functions perform better than letting LLVM
perform loop unswitching, I would have thought eliminating the dyn-dispatch
would be both clearer and faster
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]