Skip to content

Commit ec3d980

Browse files
committed
docs(bench): note why ab-bench.ps1 needs no re-exec guard
Add a .NOTES section explaining the asymmetry with the bash twin: PowerShell parses the whole script into memory before running, so the in-script `git checkout` removing this file mid-run is harmless — no re-exec needed. Keeps a future maintainer from "fixing" a non-bug.
1 parent 346ea26 commit ec3d980

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

scripts/ab-bench.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ only scenarios present on BOTH branches are compared.
2828
.EXAMPLE
2929
# Close your IDE, plug in AC power, then:
3030
./scripts/ab-bench.ps1 -Repeat 3
31+
32+
.NOTES
33+
No "re-exec from a temp copy" guard is needed here, unlike the bash twin
34+
scripts/ab-bench.sh. PowerShell parses the whole script into memory before
35+
executing, so when the in-script 'git checkout <other-branch>' removes this
36+
file (it is absent on a branch that predates the script) the running script
37+
is unaffected. The bash twin streams from its file descriptor and must
38+
re-exec out of the work tree to survive the same checkout. Verified on
39+
Windows: a committed-script main<->develop run completes and recovers cleanly.
3140
#>
3241
param(
3342
[ValidateRange(1, 10)] [int]$Repeat = 3,

0 commit comments

Comments
 (0)