Skip to content

Commit cb8dac4

Browse files
Use process name lookup instead of --pid flag in 100-iteration test
- Change perf_pid_100runs.ps1 to use 'win-witr win-witr.exe' instead of '--pid' - This automatically finds the PID by process name, simplifying the test Co-authored-by: supervoidcoder <88671013+supervoidcoder@users.noreply.github.com>
1 parent 97b4fd2 commit cb8dac4

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

tests/performance/perf_pid_100runs.ps1

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
1-
# Performance test for PID lookup - 100 iterations
2-
# Measures time taken for each execution to look up a process by PID
1+
# Performance test for process lookup - 100 iterations
2+
# Measures time taken for each execution to look up a process by name
33

4-
Write-Host "Testing PID lookup performance over 100 iterations..." -ForegroundColor Yellow
5-
6-
# Get current PowerShell PID
7-
$currentPid = $PID
4+
Write-Host "Testing process lookup performance over 100 iterations..." -ForegroundColor Yellow
85

96
# Verify win-witr works before starting measurements
10-
& win-witr --pid $currentPid | Out-Null
7+
& win-witr win-witr.exe | Out-Null
118
if ($LASTEXITCODE -ne 0) {
12-
Write-Error "win-witr --pid command failed"
9+
Write-Error "win-witr process lookup failed"
1310
exit 1
1411
}
1512

1613
# Run 100 iterations and measure each
17-
Write-Host "Running 100 iterations of win-witr --pid $currentPid..." -ForegroundColor Cyan
14+
Write-Host "Running 100 iterations of win-witr win-witr.exe..." -ForegroundColor Cyan
1815
1..100 | ForEach-Object {
1916
Measure-Command {
20-
& win-witr --pid $currentPid | Out-Null
17+
& win-witr win-witr.exe | Out-Null
2118
} | Select-Object TotalMilliseconds
2219
}
2320

0 commit comments

Comments
 (0)