[pmwiki-users] page stores
Petko Yotov
5ko at 5ko.fr
Fri Sep 4 02:58:02 CDT 2009
On Friday 04 September 2009 09:17:38 Eemeli Aro wrote:
> 2009/9/4 Hans <design5 at softflow.co.uk>:
> > Petko, could you please explain the "change summary" comment you left
> > on Cookbook.PerGroupSubdirectories:
> >
> > "PageStore is highly optimized for {$Group}/{$FullName} as opposed
> > to $Group/$FullName"
> >
> > What is the difference? You recommend to change to the new
> > {$Group}/{$FullName} ?
>
> Figured I might answer, since I'm quite certain this is the reason:
>
> The PageStore class has an internal method pagefile that maps a page
> name to its location on disk. This is run every time you need to read
> any page, and therefore has a couple of optimizations for common
> locations, such that if you're using one of a few specific strings,
> the directory format string (the first parameter given to PageStore()
> ) doesn't need to be passed through the FmtPageName function.
>
> One of these optimized strings is 'wiki.d/{$Group}/{$FullName}'. The
> end result is exactly the same as with 'wiki.d/$Group/$FullName', just
> faster.
Yes, and I changed the Cookbook page to display the optimized strings where it
was possible.
This speed optimization to calculate the filename concerns only the default
wiki.d and wikilib.d directories, as well as the 'wiki.d/{$Group}/{$FullName}'
customization (in a function named 'pagefile'). On other PageStore directories
from skins, etc., there is no difference.
Thanks,
Petko
More information about the pmwiki-users
mailing list