From f00ccd0bf65e2a8d3d0ff4a3960e32c7aeba835a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 9 Jun 2015 00:14:57 +0100 Subject: In rebuilds, assume that every page has been scanned by the time the scan phase ends 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'IkiWiki/Render.pm') diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 632ec980b..d34e39e8a 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -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); -- cgit v1.2.3