Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

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


in reply to Re^2: 5:10: Why is this slower than 5.8.8?
in thread 5:10: Why is this slower than 5.8.8?

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/slow_malloc2.pl 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/slow_malloc2.pl 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.


Comment on Re^3: 5:10: Why is this slower than 5.8.8?
Select or Download Code
Re^4: 5:10: Why is this slower than 5.8.8?
by Anonymous Monk on Dec 24, 2007 at 08:36 UTC
    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.
      This does not seem to be the public opinion in this topic. For example, FreeBSD's perl port contains the lines:
      @${ECHO} " WITHOUT_PERL_MALLOC=yes Use FreeBSD system m +alloc" @${ECHO} " (uses less memory, b +ut slower)
      And the hint file in the perl distribution used to have the following lines:
      4.*) # In FreeBSD 4 and 5 the system malloc is performance-wise # VERY bad for Perl-- we are talking of differences of not # one, but TWO magnitudes.
      This is not part of the default hint file anymore, but only because perl's malloc does not work with threaded builds, so Jarkko decided to always use the system's malloc.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-09-23 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (212 votes), past polls