develooper Front page | perl.perl5.porters | Postings from June 2002

MIME::QuotedPrint performance in 5.8.x (twice as slow)

Thread Next
From:
Elizabeth Mattijsen
Date:
June 27, 2002 08:34
Subject:
MIME::QuotedPrint performance in 5.8.x (twice as slow)
Message ID:
4.2.0.58.20020627171744.02440860@mickey.dijkmat.nl
I was working on the test-suite of IOLayer::QuotedPrint and got the 
impression that QuotedPrint encoding had become much slower.  I created the 
following benchmark script:

== qpbench 
========================================================================
use Benchmark;

use MIME::QuotedPrint qw(encode_qp decode_qp);

open( IN,"/etc/termcap" ); # some stuff to sink your teeth in
local $/ = undef;
my $decoded = <IN>;
close( IN );

my $encoded;
timethis( 10,sub { $encoded = encode_qp( $decoded ) } );

timethis( 10,sub {
   warn "Encoding/Decoding failed\n" if decode_qp( $encoded ) ne $decoded;
} );
============================================================================ 
=======

and ran the script with 5.6.0 and 5.8.0-RC2:

$ perl5.6.0 qpbench
timethis 10: 72 wallclock secs (43.43 usr + 27.97 sys = 71.40 CPU) 
@  0.14/s (n=10)
timethis 10:  5 wallclock secs ( 5.25 usr +  0.20 sys =  5.45 CPU) 
@  1.83/s (n=10)

$ perl5.8.0-RC2 qpbench
timethis 10: 140 wallclock secs (111.49 usr + 28.45 sys = 139.94 CPU) 
@  0.07/s (n=10)
timethis 10:  7 wallclock secs ( 7.04 usr +  0.17 sys =  7.21 CPU) 
@  1.39/s (n=10)

Encoding seems to take twice as much CPU now.  If you look at non-sys CPU 
it's almost 3 times as slow.  I realize that it is common knowledge that 
Perl 5.8 is going to be slower.  But this is really a _lot_ for a module 
that I assume is used heavily in email processing.

And yes, I realize that it now handles Unicode and EBCDIC, where it didn't 
do that before.  I guess it's the price of progress...  ;-(


Liz


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About