mktables: In-line defns for tables up to 3 ranges
authorKarl Williamson <public@khwilliamson.com>
Tue, 18 Mar 2014 18:17:16 +0000 (12:17 -0600)
committerKarl Williamson <public@khwilliamson.com>
Tue, 18 Mar 2014 18:51:23 +0000 (12:51 -0600)
eb0925341cc65ce6ce57503ec0ab97cdad39dc98 caused the definitions for
about 45% of the Unicode tables to be placed in-line in Heavy.pl instead
of them having to be read-in from disk.  This new commit extends that so
that about 55% are in-lined, by in-lining tables which consist of up to
3 ranges.

This is a no-brainer to do, as the memory usage does not increase by
doing it, and disk accesses go down.  I used the delta in the disk size
of Heavy.pl as a proxy for the delta in the memory size that it uses,
as what this commit does is to change various scalar strings in it.
Doing this measurement indicates that this commit results in a slightly
smaller Heavy.pl than what was there before eb092534.  The amounts will
vary between Unicode releases.  I also checked for Unicode beta 7.0, and
the sizes are again comparable, with a slightly larger Heavy.pl for the
3-range version there.

For 4-, 5-, ... range tables, doing this results in slowly increasing
Heavy.pl size (and hence more and more memory use), and that is
something we may wish to look at in the future, trading memory for fewer
files and less disk start-up cost.  But for the imminent v5.20, doing it
for 3-range tables doesn't cost us anything, and gains us fewer disk
files and accesses.

lib/unicore/mktables
pod/perldelta.pod

index 11b3231..cde1922 100644 (file)
@@ -17349,7 +17349,7 @@ sub write_all_tables() {
         if (! $is_property
             && ! $annotate  # For annotation, we want to explicitly show
                             # everything, so keep in files
-            && $table->ranges <= 1)
+            && $table->ranges <= 3)
         {
             my @ranges = $table->ranges;
             my $count = @ranges;
index ba59a42..548cb32 100644 (file)
@@ -135,7 +135,7 @@ of the implementation, including subroutine invocation and scope exit.
 =item *
 
 Perl now does less disk I/O when dealing with Unicode properties that cover
-only a single range of consecutive code points.
+up to three ranges of consecutive code points.
 
 =back