]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
In rebuilds, assume that every page has been scanned by the time the scan phase ends
authorSimon McVittie <smcv@debian.org>
Mon, 8 Jun 2015 23:14:57 +0000 (00:14 +0100)
committerSimon McVittie <smcv@debian.org>
Mon, 8 Jun 2015 23:14:57 +0000 (00:14 +0100)
This doesn't prevent memory from being used to track what we have
and haven't scanned, but it does make it temporary.

This only applies to rebuilds, as a way to avoid breaking the
templatebody plugin, unlike the earlier version of this optimization.

IkiWiki/Render.pm

index 632ec980b293cce70869e5dedb0f93249265e884..d34e39e8aac7768b73c89527cefd6e9576d1545e 100644 (file)
@@ -155,7 +155,7 @@ sub genpage ($$) {
 
 sub scan ($) {
        my $file=shift;
-       return if $scanned{$file};
+       return if ($config{rebuild} && $phase > PHASE_SCAN) || $scanned{$file};
        $scanned{$file}=1;
 
        debug(sprintf(gettext("scanning %s"), $file));
@@ -886,6 +886,10 @@ sub refresh () {
 
        # At this point it becomes OK to start matching pagespecs.
        $phase = PHASE_RENDER;
+       # Save some memory in full rebuilds: we no longer need to keep
+       # track of which pages we've scanned, because we can assume the
+       # answer is "all of them".
+       %scanned = () if $config{rebuild};
 
        remove_del(@$del, @$internal_del);