RE: [Nolug] Go

From: John Souvestre <>
Date: Thu, 12 Dec 2013 17:34:30 -0600
Message-ID: <02ca01cef792$b949f200$2bddd600$>

Hi Joe.


Will do. Probably this weekend.


Program language support: I was just reading an article about a test run on
Haskell. The author took a library module which did a Sudoku solution and fed
it 49,000 puzzles. The main routine was 11 lines of code. I'll skip some
intermediate steps. He ended up parallelizing the 49,000 puzzles to
concurrent routines spread over a 8-core machine.


His main routing grew from 11 lines to 17 lines of code. And this involved no
changes at all to the library module. Many (most?) pure functional routines
can run concurrently with no changes at all. Thus for very little additional
code he was able to get a 5.8:1 speedup. I'm very impressed by what he
achieved with so little work!


Funny note: A while back I did some multi-core testing with Perl's forks and
ithreads, under both Windows and Linux. Both sets of results from the Linux
(a server at my office) test made sense. As I added cores the wall clock time
went down accordingly (minus about 1% overhead).


But the Windows results were strange. There seemed to be a huge amount of
overhead, which got much worse as I engaged more CPUs. With all 8 CPUs I was
seeing only about a 3:1 improvement. After playing around a bit I figured it
out. I was using my laptop, which is a 4-core, 8-CPU (hyper threaded)


1) When not doing much (using 1 core, for example) it overclocks to about
170%. Intel designs them this way to counter poorer heat dissipation in
laptops. Thus my base measurement of how long the task took without
multi-core was way off, making the multi-core results (at regular clock speed)
look bad.

2) Hyper threading does not double your CPU power. Your mileage will vary,
but in my test a hyper threaded CPU was worth about 25% of a "real" CPU. I've
seen others quote figures anywhere from 10% to 50%. It depends a lot on what
you are running.


Net result: Correcting the base measurement to the normal clock speed, I was
getting a 5:1 improvement. I later ran the test on a 8-core Windows server
(constant clock speed and no Hyper Threading) and got the full 8:1. Fun! J



    John Souvestre - New Orleans LA - (504) 454-0899


From: []
On Behalf Of joe jonass
Sent: Thu, December 12, 2013 4:37 pm
Subject: Re: [Nolug] Go


Let us know how it runs.


Nolug mailing list

Received on 12/12/13

This archive was generated by hypermail 2.2.0 : 12/18/13 EST