[pmwiki-users] 2.2.0-beta36 release (pagelist template updates)

Dominique Faure dominique.faure at gmail.com
Fri Mar 16 10:16:33 CDT 2007


On 3/16/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Fri, Mar 16, 2007 at 10:06:34AM +0100, Dominique Faure wrote:
> > On 3/16/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > >I've just released 2.2.0-beta36, which adds some new features
> > >to pagelist templates.
> > [...]
> > >Thus, instead of writing control breaks using (:if:) directives, as in
> > >
> > >   (:if ! equal {<$Group} {=$Group}:)
> > >   Group: {=$Group}
> > >   (:if:)
> > >   * {=$FullName}
> > >
> > >one can now write
> > >
> > >   (:template first {=$Group}:)
> > >   Group: {=$Group}
> > >   (:template each:)
> > >   * {=$FullName}
> > >
> >
> > Out of curiosity, how does it impact on the pagelist performance: is
> > there a significative difference between both solution?
>
> I haven't done any direct measurements yet, but since can cut
> out a lot of unnecessary (:if:) markups to the rendering engine,
> it should be noticeably faster for long lists.  For example,
> the (:template:) directives in the per-group template above reduce
> the number of lines of markup to be rendered by about 75%.
>
> > BTW, this could be nice to have the $StopWatch enabled into
> > pmwiki.org's Test group.
>
> Good idea -- now done.
>

So, here's a quick and dirty bench, using both syntaxes on the Test pages:

[@
[[#default]]
(:if ! equal {=$Group} {<$Group}:)

:[[{=$Group}/]] /:
(:if:)
: :[[{=$Group}/{=$Name}]]
[[#defaultend]]
@]

(:pagelist group=Test fmt=#default:)

gives:

00.00 00.00 config start
00.00 00.00 config end
00.08 00.07 MarkupToHTML begin
00.09 00.08 FPLTemplate begin
00.09 00.08 MakePageList pre
00.09 00.08 PageListSources begin
00.10 00.09 PageStore::ls begin wiki.d/{$FullName}
00.18 00.12 PageStore::ls merge wiki.d/{$FullName}
00.22 00.15 PageStore::ls end wiki.d/{$FullName}
00.22 00.16 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
00.23 00.16 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
00.23 00.16 PageStore::ls end $FarmD/wikilib.d/{$FullName}
00.23 00.16 PageListSources end count=681
00.23 00.16 PageListSort pre ret=4 order=name
00.23 00.16 MakePageList items count=681, filters=
00.24 00.17 MakePageList post count=681, readc=0
00.24 00.17 PageListSort begin
00.28 00.22 PageListSort end
00.28 00.22 MakePageList end
00.59 00.49 MarkupToHTML begin
03.37 02.39 MarkupToHTML end
03.37 02.39 FPLTemplate end
03.38 02.39 MarkupToHTML end
03.40 02.41 MarkupToHTML begin
03.43 02.44 ReadApprovedUrls Site.ApprovedUrls begin
03.43 02.44 ReadApprovedUrls Site.ApprovedUrls end
03.45 02.46 MarkupToHTML end
03.46 02.46 MarkupToHTML begin
03.47 02.48 MarkupToHTML end
03.48 02.49 now

whereas:

[@
[[#default]]
(:template first {=$Group}:)

:[[{=$Group}/]] /:
(:template each:)
: :[[{=$Group}/{=$Name}]]
[[#defaultend]]
@]

(:pagelist group=Test fmt=#default:)

results in:

00.00 00.00 config start
00.00 00.00 config end
00.09 00.08 MarkupToHTML begin
00.11 00.10 FPLTemplate begin
00.11 00.10 MakePageList pre
00.11 00.10 PageListSources begin
00.11 00.10 PageStore::ls begin wiki.d/{$FullName}
00.21 00.13 PageStore::ls merge wiki.d/{$FullName}
00.25 00.17 PageStore::ls end wiki.d/{$FullName}
00.26 00.17 PageStore::ls begin $FarmD/wikilib.d/{$FullName}
00.26 00.17 PageStore::ls merge $FarmD/wikilib.d/{$FullName}
00.26 00.17 PageStore::ls end $FarmD/wikilib.d/{$FullName}
00.26 00.17 PageListSources end count=681
00.26 00.17 PageListSort pre ret=4 order=name
00.26 00.17 MakePageList items count=681, filters=
00.28 00.19 MakePageList post count=681, readc=0
00.28 00.19 PageListSort begin
00.32 00.23 PageListSort end
00.32 00.23 MakePageList end
00.57 00.45 MarkupToHTML begin
02.43 02.11 MarkupToHTML end
02.43 02.11 FPLTemplate end
02.44 02.12 MarkupToHTML end
02.46 02.13 MarkupToHTML begin
02.48 02.16 ReadApprovedUrls Site.ApprovedUrls begin
02.49 02.16 ReadApprovedUrls Site.ApprovedUrls end
02.51 02.19 MarkupToHTML end
02.51 02.19 MarkupToHTML begin
02.52 02.20 MarkupToHTML end
02.54 02.21 now

which is quite better!

It's time to update Site.PageListTemplates, no?

Dom



More information about the pmwiki-users mailing list