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: Use two-pass algorithm for csv to ensure correctness and SIMDize more ~17% #19088

Merged
merged 17 commits into from
Oct 5, 2024

Conversation

ritchie46
Copy link
Member

@ritchie46 ritchie46 commented Oct 3, 2024

fixes #19078

Fixed so that we always have chunks that are valid. As we now have a two pass algorithm, made sure to SIMDize more. What is lost by the two pass, is gained by SIMD. On NY city trip data I have ~17% perf improvement.

The good thing is that we are now always fast, as we don't have to fallback to single threaded code anymore when we encounter a complicated/quoted file.

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Oct 3, 2024
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 98.65772% with 6 lines in your changes missing coverage. Please review.

Project coverage is 79.78%. Comparing base (310b482) to head (1a1d3ab).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
crates/polars-io/src/csv/read/parser.rs 97.77% 4 Missing ⚠️
crates/polars-io/src/csv/read/read_impl.rs 99.29% 1 Missing ⚠️
crates/polars-io/src/csv/read/splitfields.rs 99.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #19088   +/-   ##
=======================================
  Coverage   79.78%   79.78%           
=======================================
  Files        1531     1531           
  Lines      208568   208561    -7     
  Branches     2913     2913           
=======================================
+ Hits       166405   166409    +4     
+ Misses      41612    41601   -11     
  Partials      551      551           

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

@pola-rs pola-rs deleted a comment from codspeed-hq bot Oct 5, 2024
@ritchie46 ritchie46 changed the title fix: Use two-pass algorithm for csv to ensure correctness perf: Use two-pass algorithm for csv to ensure correctness and SIMDize more Oct 5, 2024
@github-actions github-actions bot added the performance Performance issues or improvements label Oct 5, 2024
@ritchie46 ritchie46 changed the title perf: Use two-pass algorithm for csv to ensure correctness and SIMDize more perf: Use two-pass algorithm for csv to ensure correctness and SIMDize more ~17% Oct 5, 2024
@ritchie46 ritchie46 merged commit f7de80c into main Oct 5, 2024
26 checks passed
@ritchie46 ritchie46 deleted the csv branch October 5, 2024 15:59
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.

CSV reader incorrectly splits row in two pieces on quoted newline
1 participant