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

feat: Speed up starts_with for small prefixes #19904

Merged
merged 10 commits into from
Nov 22, 2024

Conversation

stijnherfst
Copy link
Collaborator

The string view type has a small (4 or <12 bytes) prefix inlined that we can use for comparisons. From a small test this is about the same speed on a worst case (search prefix > 12 bytes, string not inlined) and more than twice as fast on a best case (string <12 bytes so entirely inlined).

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature rust Related to Rust Polars labels Nov 21, 2024
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 10 lines in your changes missing coverage. Please review.

Project coverage is 79.48%. Comparing base (6c34d59) to head (023ea87).
Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
...olars-ops/src/chunked_array/strings/starts_with.rs 37.50% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19904      +/-   ##
==========================================
+ Coverage   79.40%   79.48%   +0.07%     
==========================================
  Files        1550     1555       +5     
  Lines      214909   216170    +1261     
  Branches     2447     2454       +7     
==========================================
+ Hits       170653   171815    +1162     
- Misses      43699    43797      +98     
- Partials      557      558       +1     

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


🚨 Try these New Features:

@ritchie46 ritchie46 merged commit 5b3a8f9 into pola-rs:main Nov 22, 2024
18 checks passed
@ritchie46 ritchie46 changed the title feat(rust): Speed up starts_with for small prefixes feat: Speed up starts_with for small prefixes Nov 22, 2024
@github-actions github-actions bot added the python Related to Python Polars label Nov 22, 2024
@stijnherfst stijnherfst deleted the starts-with branch November 26, 2024 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants