Performance of Get-ChildItem

  • Follow


Hello there, can anybody explain me this:

poshdev >[30]: Measure-Command { Get-ChildItem m:\ -rec }
...
TotalSeconds      : 38,5198933
...

poshdev >[31]: Measure-Command { Get-ChildItem m:\ -rec -name }; growl
gci
....
TotalSeconds      : 80,8819459
....

I would swear that the -name parameter causes that the performance
will be much better because all the other properties (attributes,
times, ...) don't have to be set.
So.. any ideas?
0
Reply stej 12/16/2009 9:07:03 AM

(the 'growl gci' command should not be there of course. Anyway, it
doesn't affect the results.)
0
Reply stej 12/16/2009 9:18:14 AM


I'm not sure why adding -name should make it run faster.

Read this Lee Holmes article for some PowerShell team thinking
about the runtime efficiency of Get-ChildItem in a file system context.
http://blogs.msdn.com/powershell/archive/2009/11/04/why-is-get-childitem-so-slow.aspx

  - Larry

stej wrote:
> Hello there, can anybody explain me this:
> poshdev >[30]: Measure-Command { Get-ChildItem m:\ -rec }
> ..
> TotalSeconds      : 38,5198933
> ..
> 
> poshdev >[31]: Measure-Command { Get-ChildItem m:\ -rec -name }; growl
> gci
> ...
> TotalSeconds      : 80,8819459
> ...
> 
> I would swear that the -name parameter causes that the performance
> will be much better because all the other properties (attributes,
> times, ...) don't have to be set.
> So.. any ideas?
0
Reply Larry__Weiss 12/16/2009 2:46:14 PM

2 Replies
640 Views

(page loaded in 0.058 seconds)

Similiar Articles:
















7/23/2012 1:54:40 PM


Reply: