I've done several tests with your code and am getting a pretty consistent 3.5 to 1 ratio. I think you may be failing to take filesystem caching into account. I ran your code and du multiple times on really large directory trees (~500k entries) and came up with 3.5x with their best times, so I think you have nothing to worry about.
Update in response to dgaramond2's reply: I'm running a much wimpier system, Sempron 2700, Ubuntu 8.04 LTS, 2.6.24, ext3(ide).
In reply to Re: How to make this perl version of "du" faster?
by gmargo
in thread How to make this perl version of "du" faster?
by dgaramond2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |