]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Memoize pagespec translation, this speeds up a build of the ikiwiki tree
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 2 Aug 2006 03:39:19 +0000 (03:39 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Wed, 2 Aug 2006 03:39:19 +0000 (03:39 +0000)
  by 10% or so.

IkiWiki.pm
debian/changelog

index 57c7d8f58d7c24a0f08f1f4c6d7c741b1afd2940..3f2ffa4ce66609ece564fedd2d058547ec133bd3 100644 (file)
@@ -10,6 +10,7 @@ use open qw{:utf8 :std};
 # Optimisation.
 use Memoize;
 memoize("abs2rel");
+memoize("pagespec_translate");
 
 use vars qw{%config %links %oldlinks %oldpagemtime %pagectime
             %renderedfiles %pagesources %depends %hooks %forcerebuild};
@@ -529,8 +530,9 @@ sub pagespec_merge ($$) { #{{{
        return "($a) or ($b)";
 } #}}}
 
-sub pagespec_match ($$) { #{{{
-       my $page=shift;
+sub pagespec_translate ($) { #{{{
+       # This assumes that $page is in scope in the function
+       # that evalulates the translated pagespec code.
        my $spec=shift;
 
        # Support for old-style GlobLists.
@@ -559,7 +561,14 @@ sub pagespec_match ($$) { #{{{
                }
        }
 
-       return eval $code;
+       return $code;
+} #}}}
+
+sub pagespec_match ($$) { #{{{
+       my $page=shift;
+       my $spec=shift;
+
+       return eval pagespec_translate($spec);
 } #}}}
 
 sub match_glob ($$) { #{{{
index 007842833d0191a1f864b5a4dff179300eb5175a..7f13a216791e1741c1a5f820c46e6a608f889055 100644 (file)
@@ -1,3 +1,10 @@
+ikiwiki (1.14) UNRELEASED; urgency=low
+
+  * Memoize pagespec translation, this speeds up a build of the ikiwiki tree
+    by 10% or so.
+
+ -- Joey Hess <joeyh@debian.org>  Tue,  1 Aug 2006 23:35:13 -0400
+
 ikiwiki (1.13) unstable; urgency=low
 
   * ikiwiki can now download and aggregate feeds with its new aggregate