This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: Pyrrhic compression in Encode
authorMichael G. Schwern <schwern@pobox.com>
Fri, 22 Feb 2002 12:10:28 +0000 (07:10 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 22 Feb 2002 18:06:01 +0000 (18:06 +0000)
Message-ID: <20020222171027.GB4181@blackrider>

p4raw-id: //depot/perl@14834

ext/Encode/compile

index 44104ef..7a40db9 100755 (executable)
@@ -290,9 +290,14 @@ END
    }
   close(D);
   close(H);
+
+  my $perc_saved    = $strings/($strings + $saved) * 100;
+  my $perc_subsaved = $strings/($strings + $subsave) * 100;
   printf STDERR "%d bytes in string tables\n",$strings;
-  printf STDERR "%d bytes (%.3g%%) saved spotting duplicates\n",$saved,100*$saved/$strings if $saved;
-  printf STDERR "%d bytes (%.3g%%) saved using substrings\n",$subsave,100*$subsave/$strings if $subsave;
+  printf STDERR "%d bytes (%.3g%%) saved spotting duplicates\n",
+    $saved, $perc_saved              if $saved;
+  printf STDERR "%d bytes (%.3g%%) saved using substrings\n",
+    $subsave, $perc_subsaved         if $subsave;
  }
 elsif ($doEnc)
  {