From fe4f176f725b069ac74561600bba982c2d9ad607 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 18 Jun 2009 15:54:53 +0100 Subject: Optimize the dependencies list On a large wiki you can spend a lot of time reading through large lists of dependencies to see whether files need to be rebuilt (album, with its one-page-per-photo arrangement, suffers particularly badly from this). The dependency list is currently a single pagespec, but it's not used like a normal pagespec - in practice, it's a list of pagespecs joined with the "or" operator. Accordingly, change it to be stored as a list of pagespecs. On a wiki with many tagged photo albums, this reduces the time to refresh after `touch tags/*.mdwn` from about 31 to 25 seconds. Getting the benefit of this change on an existing wiki requires a rebuild. --- t/index.t | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 't/index.t') diff --git a/t/index.t b/t/index.t index e79609902..107dac9d0 100755 --- a/t/index.t +++ b/t/index.t @@ -32,9 +32,9 @@ $renderedfiles{"bar.png"}=["bar.png"]; $links{"Foo"}=["bar.png"]; $links{"bar"}=["Foo", "new-page"]; $links{"bar.png"}=[]; -$depends{"Foo"}=""; -$depends{"bar"}="foo*"; -$depends{"bar.png"}=""; +$depends{"Foo"}=[]; +$depends{"bar"}=["foo*"]; +$depends{"bar.png"}=[]; $pagestate{"bar"}{meta}{title}="a page about bar"; $pagestate{"bar"}{meta}{moo}="mooooo"; # only loaded plugins save state, so this should not be saved out @@ -80,9 +80,9 @@ is_deeply(\%links, { "bar.png" => [], }, "%links loaded correctly"); is_deeply(\%depends, { - Foo => "", - bar => "foo*", - "bar.png" => "", + Foo => [], + bar => ["foo*"], + "bar.png" => [], }, "%depends loaded correctly"); is_deeply(\%pagestate, { bar => { -- cgit v1.2.3