* Memoize pagespec translation, this speeds up a build of the ikiwiki tree
by 10% or so.master
parent
3a95b4b132
commit
98f6f5e580
15
IkiWiki.pm
15
IkiWiki.pm
|
@ -10,6 +10,7 @@ use open qw{:utf8 :std};
|
||||||
# Optimisation.
|
# Optimisation.
|
||||||
use Memoize;
|
use Memoize;
|
||||||
memoize("abs2rel");
|
memoize("abs2rel");
|
||||||
|
memoize("pagespec_translate");
|
||||||
|
|
||||||
use vars qw{%config %links %oldlinks %oldpagemtime %pagectime
|
use vars qw{%config %links %oldlinks %oldpagemtime %pagectime
|
||||||
%renderedfiles %pagesources %depends %hooks %forcerebuild};
|
%renderedfiles %pagesources %depends %hooks %forcerebuild};
|
||||||
|
@ -529,8 +530,9 @@ sub pagespec_merge ($$) { #{{{
|
||||||
return "($a) or ($b)";
|
return "($a) or ($b)";
|
||||||
} #}}}
|
} #}}}
|
||||||
|
|
||||||
sub pagespec_match ($$) { #{{{
|
sub pagespec_translate ($) { #{{{
|
||||||
my $page=shift;
|
# This assumes that $page is in scope in the function
|
||||||
|
# that evalulates the translated pagespec code.
|
||||||
my $spec=shift;
|
my $spec=shift;
|
||||||
|
|
||||||
# Support for old-style GlobLists.
|
# 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 ($$) { #{{{
|
sub match_glob ($$) { #{{{
|
||||||
|
|
|
@ -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 (1.13) unstable; urgency=low
|
||||||
|
|
||||||
* ikiwiki can now download and aggregate feeds with its new aggregate
|
* ikiwiki can now download and aggregate feeds with its new aggregate
|
||||||
|
|
Loading…
Reference in New Issue