jed-users mailing list

[2006 Date Index] [2006 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: pymode.sl patch


Jörg Sommer <joerg@xxxxxxxxxxxx> wrote:
>>    if ((re_looking_at ("return[^a-zA-Z0-9_]")
>>         or re_looking_at("raise[^a-zA-Z0-9_]")
>
>Is the regexp engine really so fast? I ever thought it is better to avoid
>it in critical parts of the code.

It depends upon the context.  For example, on a 66 Mhz 486 with the
cursor at the beginning of "return", re_looking_at takes slightly more
than 1 ms per call.  On a PII running at 260 Mhz, it takes 0.15ms per
call.  And on a PIII running at 863 Mhz, it takes less than 0.02ms per
call.

These numbers were determined using

define time_re_looking_at ()
{    
   tic();
   loop (10000)
     {
        () = re_looking_at ("return[^a-zA-Z0-9_]");
     }
   vmessage ("%S seconds per call", toc()/10000);
}

--John


--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2006 date index] [2006 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]