You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oro-user@jakarta.apache.org by "Matthias L. Jugel" <ma...@first.fhg.de> on 2003/03/24 14:17:41 UTC
Performance problem with regex
Hello,
up to now oro has worked great but we are now suffering a strange
performance problem with the following regular expression:
"\\{([^:}]+):?(.*?)\\}(.*?)\\{(\\1)\\}" (Java String)
It is used to match macros in our wiki markup in the form of
{quote}
The quick brown fox ...
{quote}
We now found that this takes about 30s when we try to match a text with
inlined macros like the above with about 28-30k
I have verified that that it is the matching that takes so long by
creating a small test program that employs the oro matcher and javas
java.util.regex. It looks like the java package is marginal faster but
it still takes too long.
If this is because the regular expression is stupid or some other
reason I cannot say and would be very happy to get help. I have
appended the comparison test and a sample text.
Please completely ignore the contents of the example. It is not our
text and we would like to stay neutral in this case. The text is for
the sole purpose of the test only. So, no discussions please, there are
other places.
Thank you,
Leo.