-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
perf(rust): re-use regex capture allocation (#10302) #10335
Conversation
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.
Looks great!
|
||
// Push nulls if either the string is null or there was no match. We | ||
// distinguish later between the two by copying arr's validity mask. | ||
builders.iter_mut().for_each(|arr| arr.push_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.
Yes, makes sense. The copy doesn't add much today, but will be correct once we added a validity to polars' struct type.
@@ -15,11 +13,6 @@ use super::*; | |||
#[cfg(feature = "binary_encoding")] | |||
use crate::chunked_array::binary::BinaryNameSpaceImpl; | |||
|
|||
fn f_regex_extract<'a>(reg: &Regex, input: &'a str, group_index: usize) -> Option<Cow<'a, 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.
Yes, nice cleanup. Better to have the implementation separated from the dispatch. 👍
Solves #10302.