]> granicus.if.org Git - postgresql/commitdiff
Use zic's new "-b slim" option to generate smaller timezone files.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 19 Aug 2019 17:17:02 +0000 (13:17 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 19 Aug 2019 17:17:02 +0000 (13:17 -0400)
IANA tzcode release 2019b adds an option that tells zic not to emit
the old 32-bit section of the timezone files, and to skip some other
space-wasting hacks needed for compatibility with old timezone client
libraries.  Since we only expect our own code to use the timezone data
we install, and our code is up-to-date with 2019b, there's no apparent
reason not to generate the smallest possible files.

Unfortunately, while the individual zone files do get significantly
smaller in many cases, they were not that big to begin with; which
means that no real space savings ensues on filesystems that don't
optimize small files.  (For instance, on ext4 with 4K block size,
"du" says the installed timezone tree is the same size as before.)
Still, it seems worth making the change, if only because this is
presumably the wave of the future.  At the very least, we'll save
some cycles while reading a zone file.

But given the marginal value and the fact that this is a new code
path, it doesn't seem worth the risk of back-patching this change
into stable branches.  Hence, unlike most of our timezone-related
changes, apply to HEAD only.

Discussion: https://postgr.es/m/24998.1563403327@sss.pgh.pa.us

src/timezone/Makefile
src/tools/msvc/Install.pm

index 0b0df00035093bd38db2155b3a8b515ea5e15408..78aeab43922d9df485659a4f452e0fe78236417a 100644 (file)
@@ -55,7 +55,7 @@ zic: $(ZICOBJS) | submake-libpgport
 
 install: all installdirs
 ifeq (,$(with_system_tzdata))
-       $(ZIC) -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' $(ZIC_OPTIONS) $(TZDATAFILES)
+       $(ZIC) -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' -b slim $(ZIC_OPTIONS) $(TZDATAFILES)
 endif
        $(MAKE) -C tznames $@
 
index d109b2c906014533a112c93fbfc017d9a67c9153..1a92ed233abca49819c352b38d3e27ca268a541a 100644 (file)
@@ -365,8 +365,9 @@ sub GenerateTimezoneFiles
 
        print "Generating timezone files...";
 
-       my @args =
-         ("$conf/zic/zic", '-d', "$target/share/timezone", '-p', "$posixrules");
+       my @args = (
+               "$conf/zic/zic", '-d', "$target/share/timezone", '-p',
+               "$posixrules",   '-b', 'slim');
        foreach (@tzfiles)
        {
                my $tzfile = $_;