[tpm] Single thread Perl 5.8.8 vs. Multi-threaded Perl 5.10.1
stuart at morungos.com
Mon Sep 21 13:19:37 PDT 2009
I do remember the Perl documentation saying somewhere that threading did
have about a 20-25% performance penalty, and that's just inherent in any
Perl compiled to enable threads. I can't remember where I got that from,
though. If you want high performance, you may find it easier to use
processes with some form of IPC rather than relying on Perl threads. We
do this (on Windows, admittedly) and it does seem that our Perl without
threads is about 25% faster than ActivePerl. So your original results
are exactly in line with that. We do use a lot of multiprocessing, but
we do it by laboriously creating and coordinating Windows processes.
As to the more detailed test differences, I hesitate to comment without
knowing more about the architecture of the test, especially if SQL
databases are involved. Of course, you could try the same benchmark
using either UNIX fork()s rather than Perl threads, to see whether you
get a different result.
All the best
Shane Boyce wrote:
> Just wondering if anyone has experience with multi-threaded Perl? And if the following benchmarks are typical of people's experiences?
> I'm using a Solaris 10 system on a sun-sparc workstation and just went from the precompiled package from www.sunfreeware.com of Perl 5.8.8 to a compiled source version of Perl 5.10.1 /w multi-threading turned on.
> Benchmarks of a program I used went like this:
> I had to got to 12 threads to make it worth my while! That's a bit nuts. Is multi-threaded Perl 5.10.1 really so much slower than single threaded Perl 5.8.8? Or have I likely hindered it somehow? (I pretty sure debug mode was turned off) Thanks.
More information about the toronto-pm