[pcre-dev] [Bug 2430] Severe performance decrease in (8-bit)…

Top Page

Reply to this message
Author: admin
To: pcre-dev
Subject: [pcre-dev] [Bug 2430] Severe performance decrease in (8-bit) case-insensitive mode

--- Comment #5 from Philip Hazel <ph10@???> ---
Yes; I'm currently looking at this myself and have just figured out what is
going on. This is actually to do with finding the first character. In the "abc"
case, the loop is using memchr twice, to look for "a" or "A"; because the
latter is never found, there is a long failing search each time. In the other
case, the while loop stops when it hits either of them. The solution, I think,
is to be a bit more clever: search for "a" but if found, limit the search for
"A" to stop before "a". It's a pity there isn't a case-independent memchr(). It
was introduced because in a lot of cases it is faster then a while loop, but
clearly is bad when very long strings are involved. Watch this space - I'm
about to experiment.

You are receiving this mail because:
You are on the CC list for the bug.