[dokuwiki] Re: Performance issues

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Mon, 3 Apr 2006 21:56:23 +0200

On Sat, 1 Apr 2006 22:28:08 +0200
"Harry Fuecks" <hfuecks@xxxxxxxxx> wrote:

> On 3/31/06, Chris Smith <chris@xxxxxxxxxxxxx> wrote:
> > The utf8_substr function in Harry's phputf8 (contributions by
> > Andreas Gohr, et al) library is also much more efficient than the
> > current dokuwiki function.
> >
> >   phputf8 : 0.08seconds
> >
> > The utf8_substr function can be used as a drop in replacement for
> > the current one and the logic to use mb_substr() can be added.

Did that.
 
> > Or maybe it'd
> > be worthwhile completely replacing/substituting the current dokuwiki
> > utf8.php for phputf8.  With the full thing the mb_string library
> > check is done once and appropriate functions included.
> 
> I'd be happy to help there, if you want to. I haven't benchmarked all
> the functions yet but the most important have been benchmarked
> (results provided in download) and they all come in not far behind
> mbstring.

Maybe we will do that in the future. For now I'm quite happy with a
single drop-in file instead of a whole bunch of scripts (though I think
it boils down to three really needed ones?)

However I just changed how the mb_string checking. It now only happens
once and sets a define. Don't know if the speed enhancements are
impressive but they are a small step:

before: 

27 calls to function_exists -> 0.0002715s
14 calls to defined         -> 0.0000597s

after:

1 call  to function_exists  -> 0.0000030s
2 calls to defined          -> 0.000000?s

Andi

Other related posts: