[dokuwiki] Re: New release and DokuWiki efficiency improvements + GeSHi output caching

  • From: Galen Johnson <gjohnson@xxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 26 Jul 2006 21:03:27 -0400

Chris Smith wrote:

Hi,

In the light of the upcoming release I am going to try to find time to do some profiling of DokuWiki with xdebug looking for bottlenecks and speed improvements.

There have been discussions here occasionally about poor performance, so if any of those contributors would like to send me a copy of their problem pages, please email me directly or add a page to the sidebar demo wiki - http://wiki.jalakai.co.uk/dokuwiki/doku.php. Either way, please note whether you are running php4 or php5.



One thing that affects me is the rendering time required for pages with several sections requiring code highlighting. GeSHi has a very large overhead for some languages with large numbers of tokens requiring highlighting (e.g. php). It doesn't take many code sections on one page for the GeSHi timings to blowout.

e.g. the DokuWiki parser page, http://wiki.splitbrain.org/wiki:parser - admittedly an extreme example, has 46 sections (44 php & 2 html) to pass to GeSHi and takes about ~12 seconds to render from instructions on my server.

Implementing caching of GeSHi output reduces that to ~4 seconds for subsequent re-renders. First render is about 13.5s, but since that is for the page editor I don't see slowish response times as a problem. Of course if the page is displayed directly from cache (without rendering) it takes jig time.

For now, I've implemented caching via the code plugin (to be released soon), if wanted it could be added to the main codebase.

Some notes on it:
- although a whole page (potentially) needs to be re-rendered from instructions regularly to refresh links, <code> sections should not be affected by these changes and can be safely cached.
- code sections reused on several pages will be cached once.
- I cache based on a hash of the code itself and touch the cache on every use (re-render) which should allow a cron job to clean up out of date/rarely used files.


Cheers,

Chris

One of the things I seem to recall on the GeSHi site is the use of stylesheets, rather than having GeSHi render it dynamically...I took the time a while back to create a css file (called code.css) that I now add to to my templates. Would this help render times?

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

Other related posts: