Skip to content
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: Optimize strings slices #17996

Merged
merged 3 commits into from
Aug 1, 2024
Merged

perf: Optimize strings slices #17996

merged 3 commits into from
Aug 1, 2024

Conversation

ritchie46
Copy link
Member

@ritchie46 ritchie46 commented Aug 1, 2024

Didn't do every length combinations, but the most occurring are handled.

This doesn't do a memcopy of the string anymore, but updates the views. Depending on the size of the slice this has increasing performance improvements:

length,    improvement
4               1.17x
19             1.42

And this will scale linearly.

@github-actions github-actions bot added performance Performance issues or improvements python Related to Python Polars rust Related to Rust Polars labels Aug 1, 2024
Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 96.79487% with 5 lines in your changes missing coverage. Please review.

Project coverage is 80.51%. Comparing base (03cbfd5) to head (8810811).
Report is 2 commits behind head on main.

Files Patch % Lines
.../polars-ops/src/chunked_array/strings/substring.rs 96.12% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17996      +/-   ##
==========================================
+ Coverage   80.49%   80.51%   +0.02%     
==========================================
  Files        1496     1496              
  Lines      196639   196728      +89     
  Branches     2817     2817              
==========================================
+ Hits       158278   158395     +117     
+ Misses      37840    37812      -28     
  Partials      521      521              

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

@ritchie46 ritchie46 merged commit f4e2a09 into main Aug 1, 2024
23 checks passed
@ritchie46 ritchie46 deleted the view_slice branch August 1, 2024 19:40
@c-peters c-peters added the accepted Ready for implementation label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation performance Performance issues or improvements python Related to Python Polars rust Related to Rust Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants