[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Unexpected internal vs shell command speed result...



On Feb 18, 2011, at 11:07 AM, Dan Linder wrote:
> Knowing that shells are CPU time expensive and generally not portable across platforms I am looking into replacing it with a pure perl implementation:
>         find( sub { -f and ( $size += -s _ ) }, $DATA_DIR );

I don't know if that's an ideal pure perl implementation or not. I'm a Linux-only bigot.   :)

I'd be extremely impressed if any pure perl implementation of this consistently benchmarked well across disparate platforms compared to utilities like "du". du and equivalents only have one job to do ever, so have been engineered, written, and compiled for that one task, specifically for the architecture they're installed on. In contrast, people expect Perl to do a billion things well.

If your real-world data is only 120K then it probably doesn't matter which you use.  ;)

Thanks,

Jay Hannah
Software Architect
jhannah@mutationgrid.com | http://mutationgrid.com | 1-402-598-7782