-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Perf: Optimize CursorValues compare performance for StringViewArray (1.4X faster for sort-tpch Q11) #16509
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
Conversation
Test result: --------------------
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Query ┃ main ┃ fast_path_view ┃ Change ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ Q1 │ 106.56 ms │ 106.53 ms │ no change │
│ Q2 │ 107.52 ms │ 104.28 ms │ no change │
│ Q3 │ 666.52 ms │ 677.66 ms │ no change │
│ Q4 │ 128.45 ms │ 127.80 ms │ no change │
│ Q5 │ 258.79 ms │ 260.39 ms │ no change │
│ Q6 │ 271.88 ms │ 271.11 ms │ no change │
│ Q7 │ 427.24 ms │ 415.86 ms │ no change │
│ Q8 │ 305.82 ms │ 303.95 ms │ no change │
│ Q9 │ 316.23 ms │ 316.75 ms │ no change │
│ Q10 │ 470.93 ms │ 467.82 ms │ no change │
│ Q11 │ 281.10 ms │ 197.90 ms │ +1.42x faster │
└──────────────┴───────────┴────────────────┴───────────────┘ |
@@ -293,14 +293,19 @@ impl CursorValues for StringViewArray { | |||
self.views().len() | |||
} | |||
|
|||
#[inline(always)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For anyone else following along, I believe this is the same optimization as applied in
🤖 |
🤖: Benchmark completed Details
|
🤖 |
🤖: Benchmark completed Details
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @zhuqi-lucas -- very nice
had a look at the "regressions", I think should not be impacted by this change (thus noise). |
Which issue does this PR close?
Rationale for this change
Add fast path for CursorValues compare performance for StringViewArray.
What changes are included in this PR?
Add fast path for CursorValues compare performance for StringViewArray if the data buffer is empty, which can avoid len compare for following logic.
Are these changes tested?
Yes
Are there any user-facing changes?
No