Re: [pcre-dev] Performance improvement to pcre_exec.cpp (mat…

Página Principal
Apagar esta mensagem
Autor: Philip Hazel
Data:  
Para: Stan Switzer
CC: pcre-dev
Assunto: Re: [pcre-dev] Performance improvement to pcre_exec.cpp (match)
[This message started out as a private message, but I'm putting it onto
the mailing list since it is generally relevant. I'm assuming Stan won't
mind.]

On Fri, 2 Mar 2007, Stan Switzer wrote:

> In an earlier message I mentioned that I have a change that dramatically
> speeds up PCRE matching on systems (such as OS-X) where longjmp is slow.
>
> In brief, I replaced longjmp with a crude but effective goto-based
> mechanism. The difference in speed is stunning on OS-X.
>
> I've attached the new code and the diff-list. Interested in hearing
> what you think.


Finally, I have got round to looking at this patch. (Delay was because
it took longer to get 7.1 out that anticipated.) I have made a snapshot
release and put it here:

ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/pcre-7.2-RC1.tar.gz
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/pcre-7.2-RC1.tar.bz2
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/Testing/pcre-7.2-RC1.zip

(It isn't really a "release candidate" as there are some more things I
want to do before releasing 7.2.)

The speedup is indeed dramatic on FreeBSD (it takes less than half the
time to run the tests). OS-X has FreeBSD underneath, I believe. On
Linux, it's a few percent better. I also noticed that I could make the
frame slightly smaller since all the local variables retain their
values, so this should help on all OS.

This test release also contains all my other changes to date since 7.1
(see the ChangeLog file). Including, in particular, the hack to remove
-g from the compiler options.

Philip

--
Philip Hazel, University of Cambridge Computing Service.