[Israel.pm] unshift vs push&reverse

sawyer x xsawyerx at gmail.com
Sun Mar 29 01:47:17 PDT 2009


I learned that mandrake patches (or others) could have a serious
impact on performance of core functions. My tests were done on Ubuntu
and showed one function faster than the other and Shlomi's tests were
on Mandrake and showed the other function faster.

This reminds me of the famous DBIx::Class problem. Red Hat made a
change to perl in one of their versions that caused serious slowness
in various end usages of DBIx::Class with overloading. It didn't
impact everyone because not everyone got to those extreme cases and
used overloading necessarily, but it existed and DBIx::Class kept
warning of it (which was pretty cool, actually) and they only recently
released a stable version of perl that doesn't have that problem.

Here's a link, to whoever is interested:
http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Troubleshooting.pod#Perl_Performance_Issues_on_Red_Hat_Systems

On Sun, Mar 29, 2009 at 10:00 AM, Berler Chanan <bc.other at gmail.com> wrote:
>
> Wanna thank all of you.
> I learned so much from my question:
>
> 1) I can use 1_00 10_00 numbers (didn't know I can do that).
> 2) I learned about a new module: Benchmark (shame on me...thought Gabor used
> it literally)
>
> Your humble uneducated (yet) and well known with my bizarre
>     questions of knowledge as a perl programmer.
>         Chanan
>
> -----Original Message-----
> From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On Behalf
> Of Shlomi Fish
> Sent: Friday, March 27, 2009 3:53 PM
> To: perl at perl.org.il
> Subject: Re: [Israel.pm] unshift vs push&reverse
>
> On Friday 27 March 2009 14:22:34 sawyer x wrote:
> > These are the following results that I have from Shlomi's first test:
> > Benchmark: timing 50000 iterations of push, unshift...
> >       push: 23 wallclock secs (21.02 usr +  0.03 sys = 21.05 CPU) @
> > 2375.30/s (n=50000)
> >    unshift: 27 wallclock secs (24.27 usr +  0.04 sys = 24.31 CPU) @
> > 2056.77/s (n=50000)
> >
> >
> > Apparently here, push is faster. This is Perl 5.10.0 so there might be
> > push optimizations...
>
> This is perl-5.10.0 too:
>
> <<<
> shlomi:~$ which perl
> /usr/bin/perl
> shlomi:~$ rpm -qf /usr/bin/perl
> perl-base-5.10.0-24mdv2009.1
> shlomi:~$
> >>>
>
> Maybe the Mandriva patches affect it somewhat. I can test it with other
> perl's
> I compiled myself, but not sure how important it is.
>
> Regards,
>
>        Shlomi Fish
> --
> -----------------------------------------------------------------
> Shlomi Fish       http://www.shlomifish.org/
> Original Riddles - http://www.shlomifish.org/puzzles/
>
> God gave us two eyes and ten fingers so we will type five times as much as
> we
> read.
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://mail.perl.org.il/mailman/listinfo/perl
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.0.238 / Virus Database: 270.11.23/2016 - Release Date: 03/26/09
> 20:05:00
>
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://mail.perl.org.il/mailman/listinfo/perl


More information about the Perl mailing list