From 2a7721febd6cac1af5e7f4b4949ffe066c62c837 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 5 May 2009 23:40:09 -0400 Subject: Avoid %links accumulating duplicates. (For TOVA) This is sorta an optimisation, and sorta a bug fix. In one test case I have available, it can speed a page build up from 3 minutes to 3 seconds. The root of the problem is that $links{$page} contains arrays of links, rather than hashes of links. And when a link is found, it is just pushed onto the array, without checking for dups. Now, the array is emptied before scanning a page, so there should not be a lot of opportunity for lots of duplicate links to pile up in it. But, in some cases, they can, and if there are hundreds of duplicate links in the array, then scanning it for matching links, as match_link and some other code does, becomes much more expensive than it needs to be. Perhaps the real right fix would be to change the data structure to a hash. But, the list of links is never accessed like that, you always want to iterate through it. I also looked at deduping the list in saveindex, but that does a lot of unnecessary work, and doesn't completly solve the problem. So, finally, I decided to add an add_link function that handles deduping, and make ikiwiki-transition remove the old dup links. --- debian/NEWS | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'debian/NEWS') diff --git a/debian/NEWS b/debian/NEWS index 22513cc4a..62e1543b3 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,3 +1,12 @@ +ikiwiki (3.12) UNRELEASED; urgency=low + + You may want to run `ikiwiki-transition deduplinks /path/to/srcdir` + after upgrading to this version of ikiwiki. This command will + optimise your wiki's saved state, removing duplicate information + that can slow ikiwiki down. + + -- Joey Hess Wed, 06 May 2009 00:25:06 -0400 + ikiwiki (3.01) unstable; urgency=low If your wiki uses git, and you have a `diffurl` configured in -- cgit v1.2.3