title: Faster CPU does not increase performance while increasing number of threads does. Best shared-memory computers in industry?
body: <p>I currently have a program that benefits greatly from multithreading. It starts <strong>n</strong> threads, each thread does 100M iterations. They all use shared memory but there is no synchronization at all.
  It approximates some equation solutions and current benchmarks are:</p>
  
  <pre><code>1 thread:  precision 1 time: 150s
  4 threads: precision 4 time: 150s
  
  16 threads: precision 16 time: 150s
  32 threads: precision 32 time: 210s
  64 threads: precision 64 time: 420s
  </code></pre>
  
  <p>(Higher precision is better)</p>
  
  <p>I use Amazon EC2 'Cluster Compute Eight Extra Large Instance' which has 2 x Intel Xeon E5-2670
  As far as I understand, it has 16 real cores, thus program has linear improvement up to 16 cores.
  Also it has 2x 'hyper-threading' and my program gains somewhat from this. Making number of threads more than 32 is obviously gives no improvement.</p>
  
  <p>These benchmarks prove that access to RAM is not 'bottleneck'.</p>
  
  <p>Also I ran the program on Intel Xeon E5645 which has 12 real cores. Results are:</p>
  
  <pre><code>1 thread: precision 1 time: 150s
  4 threads: precision 4 time 150s
  12 threads: precision 12 time 150s
  24 threads: precision 24 time 220s
  </code></pre>
  
  <p><code>precision/(time*thread#)</code> is similar to Amazon computer, which is not clear for me, because each core in Xeon E5-2670 is ~1.5 faster according to cpu MHz (~1600 vs ~2600) and 
  <a href="http://www.cpubenchmark.net/cpu_list.php" rel="nofollow">http://www.cpubenchmark.net/cpu_list.php</a> 'Passmark CPU Mark' number adjusted for </p>
  
  <ol>
  <li>Why using faster processor does not improve single-threaded performance while increasing number of threads does?</li>
  <li>Is it possible to rent some server that will have Multiple CPU more powerful than 2 x Intel Xeon E5-2670 while using the shared RAM, so I can run my program without any changes and get better results? </li>
  </ol>
  
  <p>Update:</p>
  
  <p>13 threads on Xeon5645 take 196 seconds.</p>
  
  <p>Algorithm randomly explores tree which has 3500 nodes. Height of tree is 7. Each node contains 250 doubles which are also randomly accessed. It is very likely that almost no data is cached.</p>