-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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: Batch nested Parquet decoding #17542
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR is a follow up to pola-rs#17462. This batches the collects in the nested Parquet decoders, with that we can also simplify the code quite a lot. I did a benchmark where we had one column `{ 'x': pl.List(pl.Int8) }` of length `10_000_000`. Then, we read that Parquet file 50 times. Here are the results. ``` Benchmark 1: After Optimization Time (mean ± σ): 3.398 s ± 0.064 s [User: 49.412 s, System: 4.362 s] Range (min … max): 3.311 s … 3.490 s 10 runs Benchmark 2: Before Optimization Time (mean ± σ): 4.135 s ± 0.015 s [User: 59.506 s, System: 5.234 s] Range (min … max): 4.105 s … 4.149 s 10 runs Summary After Optimization ran 1.22 ± 0.02 times faster than Before Optimization ```
coastalwhite
requested review from
ritchie46,
stinodego,
orlp and
c-peters
as code owners
July 10, 2024 06:32
github-actions
bot
added
performance
Performance issues or improvements
python
Related to Python Polars
rust
Related to Rust Polars
labels
Jul 10, 2024
coastalwhite
added a commit
to coastalwhite/polars
that referenced
this pull request
Jul 10, 2024
This continues on pola-rs#17542 and now also batches the actual Nesting, not only the top decoder. I did the same benchmark with `POLARS_MAX_THREADS=1` and we again see a small speedup. But I suspect that the speedup is larger for `FixedSizeList`s and `Struct`s. ``` Benchmark 1: After Optimization Time (mean ± σ): 13.306 s ± 0.018 s [User: 12.661 s, System: 0.614 s] Range (min … max): 13.263 s … 13.335 s 10 runs Benchmark 2: Before Optimization Time (mean ± σ): 14.973 s ± 0.065 s [User: 14.422 s, System: 0.517 s] Range (min … max): 14.887 s … 15.129 s 10 runs Summary After Optimization ran 1.13 ± 0.01 times faster than Before Optimization ```
coastalwhite
added a commit
to coastalwhite/polars
that referenced
this pull request
Jul 10, 2024
This continues on pola-rs#17542 and now also batches the actual Nesting, not only the top decoder. I did the same benchmark with `POLARS_MAX_THREADS=1` and we again see a small speedup. But I suspect that the speedup is larger for `FixedSizeList`s and `Struct`s. ``` Benchmark 1: After Optimization Time (mean ± σ): 13.306 s ± 0.018 s [User: 12.661 s, System: 0.614 s] Range (min … max): 13.263 s … 13.335 s 10 runs Benchmark 2: Before Optimization Time (mean ± σ): 14.973 s ± 0.065 s [User: 14.422 s, System: 0.517 s] Range (min … max): 14.887 s … 15.129 s 10 runs Summary After Optimization ran 1.13 ± 0.01 times faster than Before Optimization ```
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a follow up to #17462. This batches the collects in the nested Parquet decoders, with that we can also simplify the code quite a lot.
I did a benchmark where we had one column
{ 'x': pl.List(pl.Int8) }
of length10_000_000
. Then, we read that Parquet file 50 times. Here are the results.The nested decoder is still relatively inefficient, but this is a step in the right direction.