- Subject: Re: pymode.sl patch
- From: "John E. Davis" <davis@xxxxxxxxxxxxx>
- Date: Wed, 9 Aug 2006 13:03:35 -0400
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]