Skip to content

Speedup interleave_views (4-7x faster) #7695

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

Merged
merged 5 commits into from
Jun 18, 2025

Conversation

Dandandan
Copy link
Contributor

@Dandandan Dandandan commented Jun 17, 2025

Which issue does this PR close?

Closes: #7688

Rationale for this change

interleave_views is really slow - taking up ~25% of the samples in SortPreservingMergeExec

We can make it faster.

interleave str_view(0.0) 100 [0..100, 100..230, 450..1000]
                        time:   [369.33 ns 371.42 ns 374.48 ns]
                        change: [−77.355% −77.199% −77.051%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) low mild
  3 (3.00%) high severe

interleave str_view(0.0) 400 [0..100, 100..230, 450..1000]
                        time:   [932.11 ns 937.68 ns 945.43 ns]
                        change: [−84.672% −84.528% −84.382%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 7 outliers among 100 measurements (7.00%)
  3 (3.00%) high mild
  4 (4.00%) high severe

interleave str_view(0.0) 1024 [0..100, 100..230, 450..1000]
                        time:   [2.0938 µs 2.1058 µs 2.1235 µs]
                        change: [−86.449% −86.310% −86.167%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe

interleave str_view(0.0) 1024 [0..100, 100..230, 450..1000, 0..1000]
                        time:   [2.2045 µs 2.2098 µs 2.2170 µs]
                        change: [−84.595% −84.493% −84.401%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) low mild
  1 (1.00%) high mild
  1 (1.00%) high severe

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jun 17, 2025
@Dandandan Dandandan changed the title Speedup interleave string views Speedup interleave string views (x4) Jun 17, 2025
@Dandandan Dandandan changed the title Speedup interleave string views (x4) Speedup interleave string views (x4-6) Jun 17, 2025
@Dandandan Dandandan force-pushed the interleave_string_views branch from cebc3dc to f9c00ff Compare June 17, 2025 20:32
@Dandandan Dandandan changed the title Speedup interleave string views (x4-6) Speedup interleave_views (x4-6) Jun 17, 2025
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

This makes a lot of sense to me -- thank you @Dandandan

@mbutrovich
Copy link
Contributor

Was the change to parquet-testing submodule intended?

@Dandandan Dandandan force-pushed the interleave_string_views branch from 7478872 to 4b7d771 Compare June 17, 2025 21:09
@Dandandan
Copy link
Contributor Author

Was the change to parquet-testing submodule intended?

Thanks - fixed

@Dandandan Dandandan changed the title Speedup interleave_views (x4-6) Speedup interleave_views (4-7x faster) Jun 17, 2025
@Dandandan Dandandan merged commit 6227419 into apache:main Jun 18, 2025
28 checks passed
@alamb
Copy link
Contributor

alamb commented Jun 18, 2025

🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

interleave_views is really slow
3 participants