Skip to content

Commit

Permalink
Merge pull request #19218 from ghalliday/issue32816
Browse files Browse the repository at this point in the history
HPCC-32816 Use a blocked allocator for keyed join to reduce contention

Reviewed-by: Mark Kelly mark.kelly@lexisnexisrisk.com
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Merged-by: Gavin Halliday <ghalliday@hpccsystems.com>
  • Loading branch information
ghalliday authored Oct 24, 2024
2 parents 25d37ce + 3c4ad7e commit aabc919
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion roxie/ccd/ccdserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26480,9 +26480,13 @@ class CRoxieServerKeyedJoinBase : public CRoxieServerActivity, implements IRecor
indexReadInput = NULL;
rootIndex = NULL;
atmostsTriggered = 0;
// Allocate blocks of rows (if fixed size) to reduce overhead and potential contention between threads
// Allocate blocks of CJoinGroup objects to reduce overhead and potential contention between threads
unsigned allocatorFlags = roxiemem::RHFblocked;
joinGroupAllocator.setown(ctx->queryRowManager().createFixedRowHeap(sizeof(CJoinGroup), activityId, allocatorFlags));

//Output rows are only created on a single thread, so it is safe to use a blocked allocator - reducing contention
//and even if no contention it reduces the critical section overhead.
rowAllocator = createRowAllocatorEx(meta.queryOriginal(), roxiemem::RHFblocked);
// MORE - code would be easier to read if I got more values from helper rather than passing from factory
}

Expand Down Expand Up @@ -26574,6 +26578,8 @@ class CRoxieServerKeyedJoinBase : public CRoxieServerActivity, implements IRecor
{
CRoxieServerActivity::reset();
joinGroupAllocator->emptyCache();
if (rowAllocator)
rowAllocator->emptyCache();
defaultRight.clear();
if (indexReadInput)
indexReadInput->reset();
Expand Down

0 comments on commit aabc919

Please sign in to comment.