]> sipb.mit.edu Git - ikiwiki.git/commitdiff
trail: Avoid massive slowdown caused by pagetemplate hook when displaying dynamic...
authorJoey Hess <joey@kitenet.net>
Wed, 23 Jan 2013 23:40:35 +0000 (10:40 +1100)
committerJoey Hess <joey@kitenet.net>
Wed, 23 Jan 2013 23:40:35 +0000 (10:40 +1100)
This seemed to be due to the pagetemplate hook calling prerender. I've
observed this making it take *minutes* for the signin page to be displayed.
ltracing ikiwiki showed it was matching pagespecs a lot.

It may be that this is still a speed pain point when rendering pages, not
just for CGI. So more work may be needed here.

IkiWiki/Plugin/trail.pm
debian/changelog

index cb94855fdd1181cb8113001f838db491db0bcc4d..d5fb2b5d624c1b21cf0fa9163b5b223a090e917e 100644 (file)
@@ -411,6 +411,8 @@ sub pagetemplate (@) {
        my $page = $params{page};
        my $template = $params{template};
 
+       return unless length $page;
+
        if ($template->query(name => 'trails') && ! $recursive) {
                prerender();
 
index cf6d90a8ac9ea8b91977267f3cbb6c97d9c92400..d1d132e1efe5fb40e70d3c32e3dfe00ce49fe27f 100644 (file)
@@ -10,6 +10,8 @@ ikiwiki (3.20121213) UNRELEASED; urgency=low
     are disabled. (smcv)
   * poll: Add expandable option to allow users to easily add new choices to
     a poll.
+  * trail: Avoid massive slowdown caused by pagetemplate hook when displaying
+    dynamic cgi pages, which cannot use trail anyway.
 
  -- Joey Hess <joeyh@debian.org>  Sat, 22 Dec 2012 16:15:24 -0400