Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Windows Server World 2007? 10??? PowerShell ??????????????????????????????????Get-Command ????????????????????????????????????????????????????????????????????????????????????
PowerShell ???????? Measure-Command ????????????????????????PowerShell ????????????EXE ????????????????????????????????????
???????????????10????????????????????????
function measure10 ([scriptblock]$sb) {
foreach ($i in 1..10) {
$tms += (Measure-Command $sb).TotalMilliseconds
}
$tms/10
}
????????????????????????????????????????????????????????????
> measure10({ Get-Command | Where-Object {$_.Verb -eq "get"} | Format-Table Verb, Noun})
50.29031
50msec ???????????????????????? Get-Command ?????????????
> measure10({ Get-Command -Verb "get" | Format-Table Verb, Noun})
15.72206
???????? 1/3 ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
Comments
Anonymous
January 01, 2003
だんだん SQL のクエリーみたくなってきましたね。。。それだけ実運用が見えてきたってことですが。Anonymous
January 01, 2003
まぁ、そこまで本気でチューニングすることはないのだろうとは思いますが。。 ただ、PowerShell の手軽さゆえに、簡単に大量のオブジェクトを生成してしまうことがあり、メモリもそれだけ消費するので、ある程度気をつけたいですね。