tfl

Measuring late vs early filtering

tfl
Jan 30th, 2015
255
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $eftotal = $lftotal = 0
  2. "{0,15} {1,15} {2,15}" -f "Early Filter", "LateFilter", 'Difference'
  3.  
  4. 1..1000 | foreach {
  5.  
  6. $ef = (Measure-Command {
  7. Get-Process Power*
  8. }).milliseconds
  9. $eftotal +=$ef
  10.  
  11. $lf = (Measure-Command {
  12. Get-Process | Where-Object name -like Power*
  13. }).Milliseconds
  14. $lftotal += $lf
  15.  
  16. $diff = $ef - $lf
  17. #"{0,15:n1} {1,15:n1} {2,15:n1}" -f $ef, $lf,$diff
  18. }
  19.  
  20. $tdiff = $eftotal - $lftotal
  21. "{0,15:n1} {1,15:n1} {2,15:n1}" -f $eftotal, $lftotal,$tdiff
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×