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: Improve cost of chunk_idx compute #16154

Merged
merged 3 commits into from
May 10, 2024
Merged

perf: Improve cost of chunk_idx compute #16154

merged 3 commits into from
May 10, 2024

Conversation

ritchie46
Copy link
Member

@ritchie46 ritchie46 commented May 10, 2024

When you have many chunks, we must traverse them to compute the access indices. The worst case is get(-1) as that needs to traverse O(n).

get(-1) is now O(1) and worst case is now O(n / 2).

Fixes #16141

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

codecov bot commented May 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.95%. Comparing base (b38aa4b) to head (e017af2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16154   +/-   ##
=======================================
  Coverage   80.95%   80.95%           
=======================================
  Files        1386     1386           
  Lines      178423   178462   +39     
  Branches     2881     2881           
=======================================
+ Hits       144437   144478   +41     
+ Misses      33493    33491    -2     
  Partials      493      493           

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

@ritchie46 ritchie46 merged commit 2004f5b into main May 10, 2024
21 checks passed
@ritchie46 ritchie46 deleted the chunk_idx branch May 10, 2024 14:42
Wouittone pushed a commit to Wouittone/polars that referenced this pull request Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance issues or improvements python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance drop in collect() for LazyFrame with pl.scan_ndjson in 0.20.25
1 participant