[wellylug] Help in finding a good technical/Linux related bookstore
Cliff Pratt
enkidu at cliffp.com
Thu Jun 14 09:34:58 NZST 2007
Bruce Hoult wrote:
> On 6/13/07, *Andrej* <andrej at paradise.net.nz
> <mailto:andrej at paradise.net.nz>> wrote:
>
> For instance if the machine were to run many of the tasks
> that were to be scripted. Each invocation of the python
> interpreter will cost you more RAM than awk or sed will. If
> the task can be done in awk or sed there's no good reason
> to choose the heavy weight alternatives. Sure, I am happy
> to use perl; but some tasks are simple enough to be accomplished
> in awk (with a ~ 300K memory footprint) or sed (take off another
> 100K?) rather than python or perl (~ 6M footprint on both
> accounts), and with less CPU overhead as well.
>
>
> I've never seen a task that runs faster (that is, uses less CPU) in awk
> or sed than in perl. And I've benchmarked quite a few of them! Even
> something as simple as awk '{print $5}' runs faster as perl -lane 'print
> $F[4]', even on tiny files.
>
> Anything that you think you want to do in a combination of sh, awl, and
> sed is far better done in Perl.
>
> If you have existing awk or sed, run them through a2p or s2p (which have
> come with Perl forever). They'll run faster. And you can add features
> more easily.
>
> If the program is going to be more than a few dozen lines then you're
> better off again in Ruby, which deals with regexps and so forth as
> neatly as Perl, and classes and OO stuff as well as Python. And has
> proper lambdas too.
>
Mary had a little Lambda,
Its fleece was red as Ruby,
She scheduled it with cron one day
And called it Ruby Tuesday
What's a Lambda?
Cheers,
Cliff
More information about the wellylug
mailing list