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: Adjust coalesce for [<tiny range>, <massive range>] #19730

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

nameexhaustion
Copy link
Collaborator

@nameexhaustion nameexhaustion commented Nov 11, 2024

In the existing logic we didn't coalesce this if the <massive range> was large enough that the distance to the chunk_size would be too big.

But I do think this is more of a nitpick as we probably don't encounter this case very often 😄

*EDIT: This causes a drop in performance compared to #19728, will be fixed in a later PR -

query time
pl.read_parquet(path) 4.162399
pl.scan_parquet(path).select(cs.by_index(range(6_000))).collect() 2.437659
pl.scan_parquet(path).select(cs.by_index(range(0, 12_000, 5))).collect() 3.838982
pl.scan_parquet(path).select(cs.by_index(range(0, 12_000, 3))).collect() 3.886243

@nameexhaustion nameexhaustion added the skip changelog Do not include in changelog label Nov 11, 2024
@github-actions github-actions bot added performance Performance issues or improvements python Related to Python Polars rust Related to Rust Polars labels Nov 11, 2024
(67108865..134217730, 3),
(134217730..201326593, 0),
(201326593..268435456, 4)
]
Copy link
Collaborator Author

@nameexhaustion nameexhaustion Nov 11, 2024

Choose a reason for hiding this comment

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

This previously gave -

[
    (0..1, 1), // <-- extremely small request
    (1..67108865, 0),
    (67108865..134217728, 2),
    (134_217_729..134_217_730, 3), // <-- extremely small request
    (134217730..201326593, 0),
    (201326593..268435456, 4),
]

@nameexhaustion nameexhaustion marked this pull request as ready for review November 11, 2024 11:25
@nameexhaustion nameexhaustion marked this pull request as draft November 11, 2024 11:29
@nameexhaustion nameexhaustion marked this pull request as ready for review November 11, 2024 11:30
@ritchie46 ritchie46 merged commit 62ef918 into pola-rs:main Nov 11, 2024
20 of 21 checks passed
@nameexhaustion nameexhaustion deleted the ranges branch November 12, 2024 00:55
nameexhaustion added a commit to nameexhaustion/polars that referenced this pull request Nov 12, 2024
@c-peters c-peters added the accepted Ready for implementation label Nov 18, 2024
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 skip changelog Do not include in changelog
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants