----- Original Message ----- From: "chm" <[email protected]>
To: "Sisyphus" <[email protected]>
Cc: "chm" <[email protected]>; <[email protected]>
Sent: Friday, September 16, 2011 9:14 PM
Subject: Re: [Perldl] auto pthread performance gain


On 9/16/2011 1:42 AM, Sisyphus wrote:

----- Original Message ----- From: "chm" <[email protected]>
To: "Chris Marshall" <[email protected]>
Cc: <[email protected]>
Sent: Tuesday, September 13, 2011 9:01 PM
Subject: Re: [Perldl] auto pthread performance gain


Running the :hisreswallclock version of t/pthread_auto.t
on the original Athlon X2 Dual Core machine with the
'$a **= 1.3' operation now shows a 2X speedup as hoped...

The current test uses '$a += 1' and '$b += 1' as the
computations.  That is all memory and no computation.
If you edit to use a more expensive operation like
'$a **= 1.3' and '$b **= 1.3' you'll see more of a
win.

Yes - "threaded" then consumes roughly half as many wallclock seconds as "unthreaded". Also, looking at Task Manager, I can see that both cores are used for the "threaded" computation, whereas the "unthreaded" computation uses just the one core.

64-bit perl 5.14.0, gcc-4.7.0:
threaded: 10.3323 wallclock secs
unthreaded: 19.6193 wallclock secs
threaded is 1.9 times faster

32-bit perl 5.14.0, gcc-3.4.5:
threaded: 4.20657 wallclock secs
unthreaded: 10.6451 wallclock secs
threaded is 2.53 times faster.

32-bit perl 5.14.0, gcc-4.5.2:
threaded: 3.33988 wallclock secs
unthreaded: 9.24037 wallclock secs
threaded is 2.77 times faster

Interesting that the 64-bit perl is so much slower than the two 32-bit perls.

The mingw64.sf team also provide a 'winpthreads' package:
http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/experimental/winpthreads/

I must try it out and see if it provides a better than 1.9x improvement for the x64 build.

Cheers,
Rob

_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to