aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-10-28 05:07:56 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-10-28 05:07:56 +0000
commitdb3b72c4822cf9057460d47654c35f0a5115139e (patch)
tree723244c830c22679398ee87bba7a2dbc5f5d8264 /IkiWiki/Plugin
parent49bf877701d89d613dcf5c2d85bd08876a636dba (diff)
downloadikiwiki-db3b72c4822cf9057460d47654c35f0a5115139e.tar
ikiwiki-db3b72c4822cf9057460d47654c35f0a5115139e.tar.gz
instead of over and over. Typical speedup is ~4x. Max possible speedup:
8x. * Add "scan" parameter to hook(), which is used to make the hook be called during the scanning pass, as well as the render pass. The meta and tag plugins need to use the new scan parameter, so will any others that modify %links. * Now that links are calculated in a separate pass, it can also precalculate backlinks in one pass, which is O(N^2) instead of the previous code that was O(N^3). A very nice speedup for wikis with lots (thousands) of pages.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/meta.pm2
-rw-r--r--IkiWiki/Plugin/tag.pm2
2 files changed, 2 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 5bcd65837..2e5fd7e76 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -13,7 +13,7 @@ my %author;
my %authorurl;
sub import { #{{{
- hook(type => "preprocess", id => "meta", call => \&preprocess);
+ hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1);
hook(type => "filter", id => "meta", call => \&filter);
hook(type => "pagetemplate", id => "meta", call => \&pagetemplate);
} # }}}
diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm
index 7a1be6bec..6d22c49fd 100644
--- a/IkiWiki/Plugin/tag.pm
+++ b/IkiWiki/Plugin/tag.pm
@@ -10,7 +10,7 @@ my %tags;
sub import { #{{{
hook(type => "getopt", id => "tag", call => \&getopt);
- hook(type => "preprocess", id => "tag", call => \&preprocess);
+ hook(type => "preprocess", id => "tag", call => \&preprocess, scan => 1);
hook(type => "pagetemplate", id => "tag", call => \&pagetemplate);
} # }}}