Uh oh!
There was an error while loading. Please reload this page.
Perf: Optimize CursorValues compare performance for StringViewArray (1.4X faster for sort-tpch Q11) - #16509
Conversation
zhuqi-lucas
commented
Jun 23, 2025
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 │
└──────────────┴───────────┴────────────────┴───────────────┘ |
| self.views().len() | ||
| } | ||
| #[inline(always)] |
There was a problem hiding this comment.
For anyone else following along, I believe this is the same optimization as applied in
alamb
commented
Jun 23, 2025
🤖 |
alamb
commented
Jun 23, 2025
🤖: Benchmark completed Details |
alamb
commented
Jun 23, 2025
🤖 |
alamb
commented
Jun 23, 2025
🤖: Benchmark completed Details |
alamb
left a comment
There was a problem hiding this comment.
Thank you @zhuqi-lucas -- very nice
Dandandan
commented
Jun 23, 2025
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