From 8783739cd326723f63f810043b8f2f2b191e9325 Mon Sep 17 00:00:00 2001 From: Gavin Halliday Date: Tue, 15 Oct 2024 16:50:54 +0100 Subject: [PATCH] HPCC-32799 Minor improvements to lookahead timing code Signed-off-by: Gavin Halliday --- thorlcr/activities/thactivityutil.cpp | 17 +++++++++-------- thorlcr/graph/thgraphslave.cpp | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/thorlcr/activities/thactivityutil.cpp b/thorlcr/activities/thactivityutil.cpp index a12336860cc..f6acb6568ea 100644 --- a/thorlcr/activities/thactivityutil.cpp +++ b/thorlcr/activities/thactivityutil.cpp @@ -120,21 +120,22 @@ class CRowStreamLookAhead : public CSimpleInterfaceOf while (requiredLeft&&running) { OwnedConstThorRow row; + bool eog = false; { LookAheadTimer timer(activity.getActivityTimerAccumulator(), activity.queryTimeActivities()); row.setown(inputStream->nextRow()); - } - if (!row) - { + if (!row) { - LookAheadTimer timer(activity.getActivityTimerAccumulator(), activity.queryTimeActivities()); row.setown(inputStream->nextRow()); + if (!row) + break; + eog = true; } - if (!row) - break; - else - writer->putRow(NULL); // eog } + + if (unlikely(eog)) + writer->putRow(NULL); + ++count; writer->putRow(row.getClear()); if (requiredLeft!=RCUNBOUND) diff --git a/thorlcr/graph/thgraphslave.cpp b/thorlcr/graph/thgraphslave.cpp index d0c87d8e7f0..4c8065b555c 100644 --- a/thorlcr/graph/thgraphslave.cpp +++ b/thorlcr/graph/thgraphslave.cpp @@ -593,7 +593,7 @@ unsigned __int64 CSlaveActivity::queryLocalCycles() const const unsigned __int64 blockedCycles = queryBlockedCycles(); if (processCycles < blockedCycles) { - IWARNLOG("CSlaveActivity::queryLocalCycles - processCycles %" I64F "u < blockedCycles %" I64F "u", processCycles, blockedCycles); + ActPrintLog("CSlaveActivity::queryLocalCycles - process %" I64F "uns < blocked %" I64F "uns", cycle_to_nanosec(processCycles), cycle_to_nanosec(blockedCycles)); return 0; } return processCycles-blockedCycles;