Note that there are some explanatory texts on larger screens.

plurals
  1. POWill multi threading provide any performance boost?
    primarykey
    data
    text
    <p>I am new to programming in general so please keep that in mind when you answer my question.</p> <p>I have a program that takes a large 3D array (1 billion elements) and sums up elements along the various axis to produce a 2D array of a projection of each side of the data. The problem here is that it is very ram intensive as the program is constantly fetching information from the ram, both reading and writing.</p> <p>The question is, will i gain any performance increases if i multithread the program or will I end up running into a RAM access bottleneck? When i say multithreading, i only mean multithreading for 2 or 4 cores, no more.</p> <p>If it helps, my current computer configuration is 2.4ghz core2 quad, 1033 fsb, 4gb ram at 667mhz.</p> <p>Thanks in advance,</p> <p>-Faken</p> <p>Edit: </p> <p>It seems to me that people here are much more interested in this question that I had first expected. I'll expand the question and post some code for those who are interested.</p> <p>First of all, a little background on me so you understand where I'm coming from. I am a mechanical engineering graduate student who some how managed to pick a topic that pretty much had nothing to do with mechanical engineering. I have taken 1 course in introductory java (forced) approximately 5 years ago and have never touched programming until about a month ago when i started my thesis in earnest. I have also taken (again forced, still don't know why) a course in electronics and computer engineering, we dealt with micro-controllers (8-bit), their inner workings, and some ASM coding for them. Other than that, I know next to nothing about programming.</p> <p>Here is the code:</p> <pre><code>int dim = 1000; int steps = 7 //ranges from 1 to 255 for (int stage = 1; stage &lt; steps; stage++) for (int j = 0; j &lt; dim; j++) for (int i = 0; i &lt; dim; i++) { sum = 0; for (int k = 0; k &lt; dim; k++) if (partMap[(((i * dim) + k) * dim) + j] &gt;= stage) sum++; projection[(j*dim) + i] = sum; } </code></pre> <p>This section of code operates on the z-axis only. The main data, due to the way it was constructed, has a strange addressing system but you don't need to worry about that. There is also other code for doing the projections of other sides of the cube but they do very different things.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload