Skip to content
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

HPCC-32816 Use a blocked allocator for keyed join to reduce contention #19218

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading