in reply to Groking grep

I'm not positive on the specifics of Benchmark, but since the first two (child_grepping and child_perlizing) start separate processes, it would make sense that their CPU time wouldn't be recorded by Benchmark. That's why child_grepping appears to be so much faster than the others...child_perlizing take so long (even though it starts a child) because it starts a separate perl interpreter for each interation, which is horrendously inefficient.

I think what you should take away from this is that standard regexes are the most efficient way to match stuff in general, I only use grep in certain situations where it lends itself to simpler code.

Enjoy

Trinary

Replies are listed 'Best First'.
Re: Re: Groking grep
by spaz (Pilgrim) on Feb 07, 2001 at 00:04 UTC
    I took the "cusr" and "csys" values as being the Child versions of the "usr" and "sys" values that inline_grepping and inline_perlizing generated.

    -- Dave