[dokuwiki] Metadata rendering changes - please help testing

  • From: Michael Hamann <michael@xxxxxxxxxxxxxxxx>
  • To: dokuwiki <dokuwiki@xxxxxxxxxxxxx>
  • Date: Sun, 08 May 2011 12:46:45 +0200

Hi,

I've added some larger changes to the metadata cache handling yesterday
and a few minutes ago as from the feedback I've got the previous
metadata cache handling code and using the title index caused major
performance problems and made the metadata handling depend on the
built-in index in a way that it can't be easily replaced by an external
search index. The new changes provide a lot of backwards compatibility
and fix even some plugins that performed poorly after my first changes.

If you don't understand the technical details please don't stop reading
but jump to the end of this email and read the instructions for testing.

The changes are:
- There is a new really simple cache mechanism: Only the modification
  time of the page and the last time metadata has been rendered is used.
  This cache can't be purged using the purge parameter and is used by
  default for the title loading and also when the old $render = true
  parameter is passed to p_get_metadata or p_get_first_heading.
- There is a new rendering limit in p_get_metadata which limits the
  number of actually rendered pages to currently 5. It can be changed
  using inc/preload.php as it is only defined when it hasn't already
  been defined. This limit can be circumvented using the
  RENDER_METADATA_UNLIMITED constant in combination with both cache
  mechanisms.
- The $render parameter has been changed from boolean to integer using a
  number of predefined constants, see
  https://github.com/splitbrain/dokuwiki/blob/master/inc/parserutils.php#L19
  for a detailed documentation of these constants.
- Metadata for the same page is never rendered twice during one run. If
  metadata is changed during one run the returned metadata will still be
  the updated one.
- The title index is no longer used for getting titles. The initial idea
  with this was that the title index should be loaded for pages with a
  lot of links. Detecting such pages is pretty much impossible and
  loading a title index with some thousands of lines just for loading 5
  titles (or even 1 title in the worst case) isn't worth the effort.
  Maybe one day we'll have a search index that can do that more
  efficiently.

I hope these changes solve all performance problems reported so far. If
you've experienced a performance loss while testing the RC release,
please try updating to the current git version and test it again. Unless
somebody should discover problems with these changes there will be the
stable release today so testing it rather sooner than later would be
good.

Testing if loading titles in pages with a lot of links works correctly
is another thing you can test, also testing plugins that display a lot
of metadata is a good thing. Try also the purge=true switch in order to
see if all limits work and you don't reach the execution time limit.

Reviewing the code in order to see if my code works in all cases you
have in mind is a good idea, too.

Michael
-- 
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: