[dokuwiki] Re: Performance issues

Mario Emmenlauer wrote:
Hi,

Chris Smith wrote:
Mario Emmenlauer wrote:
By replacing the utf8_substr() function with standard-php substr()
in feed.php, load on my server dropped from 100 down to almost zero.
This is because utf8_substr uses a perl_replace for all caracters in
a page just to guess correct page-lenght.
Jup. Try the fix I posted, it's only downside will be that utf8-
previews in the feed might not be exactly 250 (or whatever) chars
long.
A significant improvement is to be had by using mb_substr() if its available.

20 calls to utf8_substr using ...
preg_match_all  :  11 seconds
mb_substr : 0.01 seconds

Other utf_* functions have logic to use mb_* functions if they are available, but not utf8_substr. Is there a reason for that?

Chris
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: