Repository navigation
perf(cube): filter the line-envelope x and free domains before the collect - #153
Merged
Merged
Conversation
Merging this PR will not alter performance
Performance Changes
Comparing Footnotes
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The line-envelope cube build collected x, y and the free value of every row, and then the kernel dropped the rows outside the x domain and the free domain. It now filters x, and a range free value, to their domains before the collect, like the other cube builders. The filters use the kernel's closed bounds, so the cube is identical.
The filters run on the cast values after the select. Pushed into a Parquet scan as a typed predicate, the free filter made a 25 % temporal domain 1.65x faster, but an unzoomed one 1.48x slower.
Free domain, release plugin, 8M rows,
POLARS_MAX_THREADS=4, 2048 free bins, 500 x buckets, medians of 41 alternating runs:x domain, release plugin, 20M rows, 4 threads, a line target zoomed to 25 % of x. Times are medians of 3 alternating processes of 9 builds. The peak is the
phys_footprintabove the baseline, lowest of 3 processes:A free domain over 25 % of 20M rows also lowers the peak: from 198 to 75 MB (temporal) and from 356 to 159 MB (Int64) on a resident frame, and from 556 to 196 MB (Float64) on a scan. Domains over all the data use no extra memory. The free filter then costs 0 to 3 %, and the x filter 4 to 5 % on a resident frame and 0 to 5 % on a scan.
test_perf_choices.pychecks that a build with a zoomed free domain or a zoomed x domain collects only the rows inside it.test_cube.pycompares a zoomed x domain with hand-filtered rows (domain edges, NaN, inf, null) for a range and a categorical free axis.test_build_line_cubeshas an unzoomed, a zoomed-source and a zoomed-target case.Closes #140