From 01ecf8ae61089e45a27fb4770505ebe069b6b917 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/thorlcr/activities/loop/thloopslave.cpp b/thorlcr/activities/loop/thloopslave.cpp index fa66f36ef05..2694b93fb59 100644 --- a/thorlcr/activities/loop/thloopslave.cpp +++ b/thorlcr/activities/loop/thloopslave.cpp @@ -306,8 +306,14 @@ class CLoopSlaveActivity : public CLoopSlaveActivityBase { OwnedConstThorRow ret; { - LookAheadTimer t(slaveTimerStats, timeActivities); - ret.setown(curInput->nextRow()); + if (loopCounter==1) + { + // the time used in first iteration is lookahead time + LookAheadTimer t(slaveTimerStats, timeActivities); + ret.setown(curInput->nextRow()); + } + else + ret.setown(curInput->nextRow()); if (!ret) { ret.setown(curInput->nextRow()); // more cope with groups somehow....