feat: exploit PiecewiseSequence for faster take#8802
Conversation
Merging this PR will improve performance by ×2.8
Performance Changes
Tip Curious why this is faster? Comment Comparing Footnotes
|
01e95cb to
eb83451
Compare
4272937 to
02adf44
Compare
eb83451 to
e79ec4b
Compare
4ff991e to
de4a71f
Compare
b615895 to
6dcc52a
Compare
12a04f6 to
6280163
Compare
6dcc52a to
a2cbdf0
Compare
6280163 to
71c3d0e
Compare
a2cbdf0 to
d694338
Compare
490e9db to
ed7bbe2
Compare
c94c4ef to
1fdda1c
Compare
56b0394 to
80bfa43
Compare
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
80bfa43 to
09ca199
Compare
Polar Signals Profiling ResultsLatest Run
Previous Runs (6)
Powered by Polar Signals Cloud |
Benchmarks: Vortex queries 📖Verdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.083x ➖, 0↑ 1↓)
datafusion / parquet (0.966x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (0.965x ➖, 0↑ 0↓)
duckdb / parquet (1.027x ➖, 0↑ 0↓)
No file size changes detected. |
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
Signed-off-by: Daniel King <dan@spiraldb.com>
| indices: &ArrayRef, | ||
| ctx: &mut ExecutionCtx, | ||
| ) -> VortexResult<Option<ArrayRef>> { | ||
| if let Some(piecewise_indices) = indices.as_opt::<PiecewiseSequence>() |
There was a problem hiding this comment.
To be clear, this would happen because we have a List(List) and we've taken the outer list. This ensures we doubly explode those outer indices.
| @@ -127,6 +145,438 @@ fn _take<I: IntegerPType, O: IntegerPType, OutputOffsetType: IntegerPType>( | |||
| .into_array()) | |||
| } | |||
|
|
|||
There was a problem hiding this comment.
This whole sequence kinda sucks but I don't know how to make it less verbose. We need to dispatch on four things: starts, lengths, input-list-offsets, and output-list-offsets.
There was a problem hiding this comment.
And everything is splayed in two because there's the constant vs non-constant lengths path.
There was a problem hiding this comment.
I think you can come up with a widening that would reduce it for temporary state but not quite sure otoh. We can merge this and figure out how to abbreviate it
Signed-off-by: Daniel King <dan@spiraldb.com>
List(List(...(List(Primitive))).take(indices)keeps broadening the slices all the way down to the Primitive array.