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

fix: Polars thread pool was not used properly in various functions #14583

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

nameexhaustion
Copy link
Collaborator

@nameexhaustion nameexhaustion commented Feb 19, 2024

Found these by running py.test with a rayon fork that panicked on attempts to use the global thread pool.

In theory it might be possible to initialize rayon's global thread pool with a start_handler that panics for debug builds, but I couldn't try it because I don't know where to put the call to build the thread pool - I can't call it outside of function contexts because it wasn't a const fn.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Feb 19, 2024
@nameexhaustion nameexhaustion marked this pull request as ready for review February 19, 2024 06:47
Copy link

codecov bot commented Feb 19, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (df5dd43) 77.94% compared to head (29e9052) 77.94%.

Files Patch % Lines
crates/polars-ops/src/frame/join/asof/groups.rs 87.50% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14583      +/-   ##
==========================================
- Coverage   77.94%   77.94%   -0.01%     
==========================================
  Files        1326     1326              
  Lines      173058   173050       -8     
  Branches     2448     2448              
==========================================
- Hits       134892   134880      -12     
- Misses      37722    37726       +4     
  Partials      444      444              

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

@nameexhaustion nameexhaustion changed the title fix: polars thread pool was not used in various functions fix: Polars thread pool was not used properly in various functions Feb 19, 2024
Copy link
Member

@ritchie46 ritchie46 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I will tag this as performance as well. As this will save a lot unexpected contention.

@ritchie46 ritchie46 added the performance Performance issues or improvements label Feb 20, 2024
@ritchie46 ritchie46 merged commit 606cc7a into pola-rs:main Feb 20, 2024
21 of 22 checks passed
@nameexhaustion nameexhaustion deleted the rayon branch February 22, 2024 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix 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.

None yet

2 participants