Skip to content

Commit d307409

Browse files
fix always execute capture perf for external runner
1 parent 1d9824c commit d307409

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

codeflash/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# These version placeholders will be replaced by uv-dynamic-versioning during build.
2-
__version__ = "0.20.0.post510.dev0+b8932209"
2+
__version__ = "0.20.0"

packages/codeflash/runtime/capture.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -710,12 +710,12 @@ function capturePerf(funcName, lineId, fn, ...args) {
710710

711711
for (let batchIndex = 0; batchIndex < batchSize; batchIndex++) {
712712
// Check shared time limit BEFORE each iteration
713-
if (shouldLoop && checkSharedTimeLimit()) {
713+
if (!hasExternalLoopRunner && shouldLoop && checkSharedTimeLimit()) {
714714
break;
715715
}
716716

717717
// Check if this invocation has already reached stability
718-
if (getPerfStabilityCheck() && sharedPerfState.stableInvocations[invocationKey]) {
718+
if (!hasExternalLoopRunner && getPerfStabilityCheck() && sharedPerfState.stableInvocations[invocationKey]) {
719719
break;
720720
}
721721

@@ -724,7 +724,7 @@ function capturePerf(funcName, lineId, fn, ...args) {
724724

725725
// Check if we've exceeded max loops for this invocation
726726
const totalIterations = getTotalIterations(invocationKey);
727-
if (totalIterations > getPerfLoopCount()) {
727+
if (!hasExternalLoopRunner && totalIterations > getPerfLoopCount()) {
728728
break;
729729
}
730730

@@ -776,7 +776,7 @@ function capturePerf(funcName, lineId, fn, ...args) {
776776
}
777777

778778
// Check stability after accumulating enough samples
779-
if (getPerfStabilityCheck() && runtimes.length >= getPerfMinLoops()) {
779+
if (!hasExternalLoopRunner && getPerfStabilityCheck() && runtimes.length >= getPerfMinLoops()) {
780780
const window = getStabilityWindow();
781781
if (shouldStopStability(runtimes, window, getPerfMinLoops())) {
782782
sharedPerfState.stableInvocations[invocationKey] = true;
@@ -785,7 +785,7 @@ function capturePerf(funcName, lineId, fn, ...args) {
785785
}
786786

787787
// If we had an error, stop looping
788-
if (lastError) {
788+
if (!hasExternalLoopRunner && lastError) {
789789
break;
790790
}
791791
}

0 commit comments

Comments
 (0)