Skip to content

Instantly share code, notes, and snippets.

@mazzy-ax
Last active January 20, 2018 13:42
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 mazzy-ax/cdbd08f3997894bec32914e23446f020 to your computer and use it in GitHub Desktop.
Save mazzy-ax/cdbd08f3997894bec32914e23446f020 to your computer and use it in GitHub Desktop.
$Path = 'C:\AOSService\PackagesLocalDirectory\'
$Path = 'C:\AOSService\PackagesLocalDirectory\ApplicationSuite'
#$Path = 'C:\AOSService\PackagesLocalDirectory\ApplicationSuite\Foundation\AxForm'
#$Path = 'C:\AOSService\PackagesLocalDirectory\Currency\'
$filter = '*.xml'
# 117592 files - 21 sec
measure-command {
$d =
Get-ChildItem -Path $Path -Filter '*.xml' -File -Force -Recurse
}
# 117592 files - 38 sec, 4 threads
measure-command {
$d =
(Resolve-Path $Path).Path |
Split-Pipeline -Refill {process{
Get-ChildItem -LiteralPath $_ -Directory -Force | ForEach-Object { [ref]$_.FullName }
Get-ChildItem -LiteralPath $_ -Filter '*.xml' -File -Force | ForEach-Object { $_.FullName }
}}
}
$d.count
$d | Select-Object -First 3 | ft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment