digitalmars.D.learn - cpu % usage decreases when (unrelated) memory usage increases
- Christiaan (10/10) Jan 29 2015 Dear reader,
- Adam D. Ruppe (3/3) Jan 29 2015 Can you post any of the code itself? My guess would be that
- =?UTF-8?B?QWxpIMOHZWhyZWxp?= (4/5) Jan 29 2015 If the memory is too large, needing to be swapped to and from disk, then...
Dear reader, I have a class X that has a (possibly) heavy array of data S as a member. A method f of X makes use of a foreach loop over taskPool(some_other_array Y). The thing is that when I increase the length of S, linux/top shows me that my D program only uses 10% of my cpu capacity. This percentage varies with the length of S. From my perspective, S has nothing to do with X.f. Can someone please explain what might be the issue here? regards, Chris
Jan 29 2015
Can you post any of the code itself? My guess would be that something is being cached by the processor - is the code itself faster or slower when the cpu changes?
Jan 29 2015
On 01/29/2015 12:33 PM, Christiaan wrote:Can someone please explain what might be the issue here?If the memory is too large, needing to be swapped to and from disk, then your program may be waiting for I/O instead of doing actual work. Ali
Jan 29 2015