aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-11-16 12:28:01 -0400
committerJoey Hess <joey@kitenet.net>2013-11-16 12:28:01 -0400
commit992d4f52ff2801a48d85b65209cccc26efe8bd8c (patch)
treebb262f2a6bf31748ed9fcbc99e7b5bc9ee45a683
parent38aebbdc0625f16739d009923e9021e839529cfc (diff)
downloadikiwiki-992d4f52ff2801a48d85b65209cccc26efe8bd8c.tar
ikiwiki-992d4f52ff2801a48d85b65209cccc26efe8bd8c.tar.gz
Fixed unncessary tight loop hash copy in saveindex where a pointer can be used instead. Can speed up refreshes by nearly 50% in some circumstances.
I *think* this is ok, at least it results in close to the same index being saved as before. The difference is that plugins that have a pagestate of {} have that recorded this way, while with the tight loop, the key for the plugin in not copied in that case. I cannot see how this could matter.
-rw-r--r--IkiWiki.pm6
-rw-r--r--debian/changelog3
2 files changed, 4 insertions, 5 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 87ddb1b56..9ccb92a4d 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -1914,11 +1914,7 @@ sub saveindex () {
}
if (exists $pagestate{$page}) {
- foreach my $id (@plugins) {
- foreach my $key (keys %{$pagestate{$page}{$id}}) {
- $index{page}{$src}{state}{$id}{$key}=$pagestate{$page}{$id}{$key};
- }
- }
+ $index{page}{$src}{state}=$pagestate{$page};
}
}
diff --git a/debian/changelog b/debian/changelog
index 92c97e947..fcd47494d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,9 @@ ikiwiki (3.20130904.2) UNRELEASED; urgency=low
* aggregate: Improve display of post author.
* poll: Fix behavior of poll buttons when inlined.
+ * Fixed unncessary tight loop hash copy in saveindex where a pointer
+ can be used instead. Can speed up refreshes by nearly 50% in some
+ circumstances.
-- Joey Hess <joeyh@debian.org> Thu, 05 Sep 2013 10:01:10 -0400