summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-08-23 13:47:37 -0600
committerKarl Williamson <public@khwilliamson.com>2012-08-25 23:21:28 -0600
commit15896d2f753bef49b0736f497e92161d548b0a87 (patch)
tree55c5cd3064622292078ea6d03e95bce3f68d617d /regen
parentf0fdc1c93fe4410df3f4f4d0c836005cec3b7f55 (diff)
downloadperl-15896d2f753bef49b0736f497e92161d548b0a87.tar.gz
Add caching to inversion list searches
Benchmarking showed some speed-up when the result of the previous search in an inversion list is cached, thus potentially avoiding a search in the next call. This adds a field to each inversion list which caches its previous search result.
Diffstat (limited to 'regen')
-rw-r--r--regen/mk_invlists.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl
index 9cdbd4ca8e..b1e472319a 100644
--- a/regen/mk_invlists.pl
+++ b/regen/mk_invlists.pl
@@ -15,7 +15,7 @@ require 'regen/regen_lib.pl';
# in the headers is used to minimize the possibility of things getting
# out-of-sync, or the wrong data structure being passed. Currently that
# random number is:
-my $VERSION_DATA_STRUCTURE_TYPE = 1064334010;
+my $VERSION_DATA_STRUCTURE_TYPE = 290655244;
my $out_fh = open_new('charclass_invlists.h', '>',
{style => '*', by => $0,
@@ -55,6 +55,7 @@ sub output_invlist ($$) {
print $out_fh "\t", scalar @$invlist, ",\t/* Number of elements */\n";
print $out_fh "\t0,\t/* Current iteration position */\n";
+ print $out_fh "\t0,\t/* Cache of previous search index result */\n";
print $out_fh "\t$VERSION_DATA_STRUCTURE_TYPE, /* Version and data structure type */\n";
print $out_fh "\t", $zero_or_one,
",\t/* 0 if this is the first element of the list proper;",