More File Performance Q.?

Ned Konz ned at bike-nomad.com
Thu May 16 16:39:56 UTC 2002


Sometimes it's just a matter of using the right tool for the job:

My fastest Squeak version takes 1982 msec to do the job.

So this is only 4x as slow as the equivalent Perl program:
490 msec:

time perl -i.orig -pe '/^[Ff]rom [^@]*$/ && print " "' maildir/*

which also renames the original files to *.orig

Incidentally, Ruby takes 1521 msec to do it (this is also a valid Perl 
program):
time ruby -i.orig -pe 'print " " if /^[Ff]rom [^@]*$/' maildir/*

And sed takes 1556 msec (!) to do it:
time sed -e '/^[Ff]rom [^@]*$/s/^/ /' inbox > inbox.txt

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE




More information about the Squeak-dev mailing list