On Sat, Aug 03, 2002 at 10:58:24AM +0200, Paul Johnson wrote:
> 
> On Fri, Aug 02, 2002 at 02:08:25AM -0400, Paul Tremblay wrote:
> 
> > (I know I did a little test with sed, a python script, and a perl
> > script, just changing the word "the" to "teh" in a huge file. Sed and
> > python took about he same time, while perl was six times faster.)
> 
> This is from the perl source code (sv.c if you are interested):
> 
>     /* Here is some breathtakingly efficient cheating */
> 
>           if (rslen) {
>               while (cnt > 0) {                    /* this     |  eat */
>                   cnt--;
>                   if ((*bp++ = *ptr++) == rslast)  /* really   |  dust */
>                       goto thats_all_folks;        /* screams  |  sed :-) */
>               }
>           }
>           else {
>               Copy(ptr, bp, cnt, char);            /* this     |  eat */
>               bp += cnt;                           /* screams  |  dust */
>               ptr += cnt;                          /* louder   |  sed :-) */
>               cnt = 0;
>           }
> 
> 

Is this for real, and not a joke? If so, it is pretty funny!

Paul
-- 

************************
*Paul Tremblay         *
*[EMAIL PROTECTED]*
************************

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to