[Melbourne-pm] Perl much slower on freebsd than solaris

Tim Hogard thogard at abnormal.com
Thu Apr 26 00:16:52 PDT 2012


Thanks for that.
> 
> You're copying a lot of numbers into your hash, and performing hashes on
> those numbers.  I suspect then that the value of something like longsize
> might be important, and you can see from the perl config info that it's
> different.  also ptrsize, use64bitint and use64bitall, ivsize, etc.  the
> stackprotector bit probably makes a bit of difference too, but I'd have
> expect that to be only a few percent.
> 
> What happens if you do it this way?
> 
> foreach $i ("0000001" .. "1000000") {
>     $i{$i}=$i;
> }
0m4.116s and 0m22.661s

> 
> I suspect that removes a lot of the 4 byte vs 8 byte bits.
> 
> As you say, doubling seems like an upper limit for copying type
> operations.  I wonder what the hashing algorithm looks like though.
> 
> What's the comparison like if you take both the integer and the hashing
> operations out like so?
> 
> $p = "1234567";
> foreach $i ("0000001" .. "1000000") {
>     $p |= $i;
> }

Too quick so I used this:
 $p = "1234567";
foreach $j (1..10) {
 foreach $i ("0000001" .. "1000000") {
     $p |= $i;
 }
}
0m6.601s and 0m7.139s
That is more what I expected.  I had started with something like
that but it was too quick.  I wonder what I had done before I put
in the hash.  So it appears that the hashing is much slower on the
64 bit than 32 bit system.  That I can live with.

Someone on a different list told me that FreeBSD is only "tuned"
for x86 and amd64 so there are plenty of kernel structures that can
been tuned

-tim


More information about the Melbourne-pm mailing list