From b687edd95331d7421fa89f4f4ad42f9e0b5faddd Mon Sep 17 00:00:00 2001 From: Shamser Ahmed Date: Wed, 13 Nov 2024 11:43:05 +0000 Subject: [PATCH] HPCC-32933 Only count the first iteration time input processing for the purposes of lookahead Signed-off-by: Shamser Ahmed --- thorlcr/activities/loop/thloopslave.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/thorlcr/activities/loop/thloopslave.cpp b/thorlcr/activities/loop/thloopslave.cpp index fa66f36ef05..58b4382a81e 100644 --- a/thorlcr/activities/loop/thloopslave.cpp +++ b/thorlcr/activities/loop/thloopslave.cpp @@ -306,13 +306,27 @@ class CLoopSlaveActivity : public CLoopSlaveActivityBase { OwnedConstThorRow ret; { - LookAheadTimer t(slaveTimerStats, timeActivities); - ret.setown(curInput->nextRow()); - if (!ret) + if (loopCounter==1) { - ret.setown(curInput->nextRow()); // more cope with groups somehow.... + // the time used in first iteration is lookahead time + LookAheadTimer t(slaveTimerStats, timeActivities); + ret.setown(curInput->nextRow()); if (!ret) - break; + { + ret.setown(curInput->nextRow()); // more cope with groups somehow.... + if (!ret) + break; + } + } + else + { + ret.setown(curInput->nextRow()); + if (!ret) + { + ret.setown(curInput->nextRow()); // more cope with groups somehow.... + if (!ret) + break; + } } }