Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: 5:10: Why is this slower than 5.8.8?

by polettix (Vicar)
on Dec 23, 2007 at 04:36 UTC ( #658738=note: print w/ replies, xml ) Need Help??


in reply to 5:10: Why is this slower than 5.8.8?

Uhm, I probably hit another dark corner:

#!/usr/bin/perl use strict; use warnings; use Benchmark qw( cmpthese ); cmpthese -2, { by_substr => sub { my $nomedir = '20070502-11'; my $anno = substr $nomedir, 0, 4; my $mese = substr $nomedir, 4, 2; my $giorno = substr $nomedir, 6, 2; my $progressivo = substr $nomedir, 9, 2; }, by_unpack => sub { my $nomedir = '20070502-11'; my ($anno, $mese, $giorno, $progressivo) = unpack 'A4 A2 A2 x A2', $nomedir; }, }; poletti@PolettiX:~/sviluppo/perl$ /opt/perl-5.8.8/bin/perl numstat.pl Rate by_unpack by_substr by_unpack 417553/s -- -32% by_substr 613303/s 47% -- poletti@PolettiX:~/sviluppo/perl$ /opt/perl-5.10.0/bin/perl numstat.pl Rate by_unpack by_substr by_unpack 372754/s -- -34% by_substr 565358/s 52% -- poletti@PolettiX:~/sviluppo/perl$ /opt/perl-5.8.8/bin/perl numstat.pl Rate by_unpack by_substr by_unpack 415531/s -- -33% by_substr 616325/s 48% -- poletti@PolettiX:~/sviluppo/perl$ /opt/perl-5.10.0/bin/perl numstat.pl Rate by_unpack by_substr by_unpack 374480/s -- -33% by_substr 562716/s 50% -- poletti@PolettiX:~/sviluppo/perl$ /opt/perl-5.8.8/bin/perl numstat.pl Rate by_unpack by_substr by_unpack 415531/s -- -33% by_substr 616325/s 48% -- poletti@PolettiX:~/sviluppo/perl$ /opt/perl-5.10.0/bin/perl numstat.pl Rate by_unpack by_substr by_unpack 369821/s -- -34% by_substr 562716/s 52% --
I made some repeated calls just to be sure not to hit some "spots".

Update: I forgot to say that I'm under Linux, and that the two perls where compiled with the same configure options (-des for 5.8.8, and a more verbose -de for 5.10.0).

Hey! Up to Dec 16, 2007 I was named frodo72, take note of the change! Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Io ho capito... ma tu che hai detto?


Comment on Re: 5:10: Why is this slower than 5.8.8?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://658738]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2015-07-04 10:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (59 votes), past polls