Commit 0fd547c
perf: skip concurrency overhead in BaseSingleBlockCombineOperator when numTasks=1
When a query runs with a single execution task (e.g. one segment or
maxExecutionThreads=1), BaseSingleBlockCombineOperator still incurred the
full multi-thread overhead: ExecutorService.submit(), Phaser registration/
deregistration, BlockingQueue.poll() with timeout, AtomicInteger, and
AtomicReference.
This adds a single-thread fast path in getNextBlock(): when _numTasks==1
and _resultsBlockMerger is non-null (i.e. the subclass uses the default
merge strategy), segments are processed sequentially on the calling thread
with none of that synchronization overhead. CPU time and memory are still
tracked via ThreadResourceSnapshot.
Subclasses that override mergeResults() with custom logic (e.g.
SequentialSortedGroupByCombineOperator, which passes null for
_resultsBlockMerger) are unaffected and continue using the standard path.
Fixes #14617
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 2e80bff commit 0fd547c
1 file changed
Lines changed: 50 additions & 0 deletions
File tree
- pinot-core/src/main/java/org/apache/pinot/core/operator/combine
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
60 | 64 | | |
61 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
62 | 69 | | |
63 | 70 | | |
64 | 71 | | |
| |||
69 | 76 | | |
70 | 77 | | |
71 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
72 | 122 | | |
73 | 123 | | |
74 | 124 | | |
| |||
0 commit comments