Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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

by eserte (Deacon)
on Dec 23, 2007 at 10:32 UTC ( #658762=note: print w/replies, xml ) Need Help??

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

Try compiling both perls with usemymalloc=y. FreeBSD's malloc may be very slow in some situations.
  • Comment on Re: 5:10: Why is this slower than 5.8.8?

Replies are listed 'Best First'.
Re^2: 5:10: Why is this slower than 5.8.8?
by jk2addict (Chaplain) on Dec 23, 2007 at 17:06 UTC
    Thanks for that thought. I'll give that a try for sure. If using FreeBSD malloc solves the problem, I'd vote that it should be the default in Configure given the nature of the 50% performance difference for a common idiom.

      Perl's malloc is fine.

        Try to compile 2 versions of perl5.8 on FreeBSD - one with mymalloc, other - without. And then compare their perfomances. You will be very dissapointed. The one which uses FREEBSD's malloc will be 20-30% faster in almost any operations.
Re^2: 5:10: Why is this slower than 5.8.8?
by Anonymous Monk on Dec 23, 2007 at 17:39 UTC
    usemymalloc=y will bring 20-30% more perfomance penalty! This is stupid trying to solve one slowdown by another slowdown. FreeBSD's malloc is faster than perl's malloc anyway.
      Well, then try the following script
      my $max = 50000; my @l = ('a'..'z'); my @keys = map { join '', map $l[rand @l], 0..71 } 0..$max;
      On my system running this script with a perlmalloc-built perl is 600x (!) faster than with a sysmalloc-built perl:
      $ time /usr/local/src/perl-5.10.0-perlmalloc/perl -I/usr/local/src/per +l-5.10.0-perlmalloc/lib ~/trash/ 3.027u 0.435s 0:03.68 93.7% 1448+324155k 0+0io 0pf+0w $ time /usr/local/src/perl-5.10.0-sysmalloc/perl -I/usr/local/src/perl +-5.10.0-sysmalloc/lib ~/trash/ 405.090u 189.574s 13:01.52 76.0% 1466+495449k 0+0io 0pf+0w
      This is a pathological case, but this may happen with FreeBSD's malloc.
        You found one case on 10000. Other 9999 cases is slower with perl's malloc. And this is not the subject of the topic! Class::Accessor::Grouped anyway runs faster without perl's malloc and the problem is not in the type of malloc.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2018-12-10 04:16 GMT
Find Nodes?
    Voting Booth?
    How many stories does it take before you've heard them all?

    Results (47 votes). Check out past polls.

    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!