Change some search index update code to do two regexps backwards.
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 22 Aug 2004 09:08:04 +0000 (09:08 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 22 Aug 2004 09:08:04 +0000 (09:08 +0000)
commit45d7e620ab312861e17e95fdcb4cfe75a3b564bd
tree6ec9921ea9fd53b7f1f296ef64ad9aeb141922cc
parentc5410557fe6f715e41f59bc0eba568de5907ea3c
Change some search index update code to do two regexps backwards.

These tail-anchored regexps are insanely slow. The worst case comes
when Japanese or Chinese text (ie, no word spacing) is written on
a wiki configured for Western UTF-8 mode: the Unicode characters are
expanded to hex codes and the "words" are very long paragraph-length
monstrosities. On a large page the previous regexps may take over 20
seconds *each* on a 1GHz-level processor on such pages of non-trivial
length...

The reversed versions which are consistently much faster, for instance
by a factor of 10000 for the pathological case and a factor of 10 for
more typical English-style pages.
includes/SearchUpdate.php