Skip to content

Instantly share code, notes, and snippets.

@SteveL-MSFT
Created October 18, 2019 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SteveL-MSFT/dded71c054c491b2eda2546e2d88849c to your computer and use it in GitHub Desktop.
Save SteveL-MSFT/dded71c054c491b2eda2546e2d88849c to your computer and use it in GitHub Desktop.
Startup perf test
$num = 50
$ps = @("powershell.exe", "C:\Program Files\PowerShell\6\pwsh.exe", "C:\Program Files\PowerShell\7-preview\pwsh.exe")
$ps | ForEach-Object {
$thisps = $_
$psv = & $thisps -nop -c '$psv = $psversiontable.gitcommitid; if ($psv -eq $null) { $psv = $psversiontable.psversion.tostring() }; $psv'
[int]$i = 0
1..$num | ForEach-Object {
$i += (Measure-Command {
& $thisps -nop -c exit
}).TotalMilliseconds
}
[PSCustomObject]@{
PSVersion = $psv
"Time (ms)" = $i / $num
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment