locked
Calculation Intensive Programs on Windows 7 usingVisual Programming Pro 2008 RRS feed

  • Question

  • Hi,

    I have created a integeter based loop which is calculation intensive - there are 120million calculations to complete which outputs the results to a textbox.

    For a small run (6million)  the PC is ok - running Windows 7 64bit and core I5 processor - output complete in 10 seconds.

    When i attempt to loop 30million times - the program takes much longer than 20 times - in fact the program seems to be hanging - and Not Responding message in title bar.

    A similar situation occurred on the work PC - Windows 7 64bit, Excel 2010 with VBA macro running. Excel is stated to be Not Responding. The macro runs ok on Excel 2003 on Vista 64bit.

    As such is there a bug in Windows 7 that locks the program and set the CPU to be 100% - 25% for quad core ???

    Or is it anti-virus - i have MacAfee on work latptop and home laptop. 

    This is really frustrating - currently the program for 120million calculations has been running for 20minutes and still not stopped.

    Thanks and regards,

    Richard.

    Thursday, March 29, 2012 12:15 AM

Answers

All replies

  • How does the system look when it runs, high RAM/CPU usage or page file activity
    ? Also, how is the calculation being performed? is it using any kind of recursion or is it a simple for/while loop?
    Thursday, March 29, 2012 7:29 PM
  • Hi Mike,

    Thanks for the reply.

    I have 6GB RAM - and the maximum usage is 1.6GB. Paged memory is 230MB, non-Paged is 74MB.

    Program i assigned 28MB when running and varies down to 20MB also.

    The loop is not recursive, it is a simple for loop.

    CPU usage in processes is 25%.

    I removed McAfee anti virus - on home laptop - and these are the results above.

    Hence i think i have removed the possibility it is the anti-virus.

    Hard disk usage seems minimal.

    I am about to try this on Vista 64bit as the macro i indicated ran ok in Excel 2003 on this machine.

    At this point t has been running for 8 minutes and still not finished.

    Regards,

    Richard.

    Thursday, March 29, 2012 9:04 PM
  • Hi,

    I ran the program for 1 hour 20 minutes - it completed 190,000 calculations which were :

    1. multiply an integer with a double, 4 times

    2. Add to a string.

    3. Repeat

    It may be that the string is causing the program to be slow - since the system has to assign memory as the string increases.

    The 190,000 calculations per 80 minutes is approximately 40 results per second - for a processor running at turbo mode as per the Intel gadget - 2.9GHz - this i would anticipate to be rather slow.

    Is this a .NET lack of optimisation ?. Or should i assign at run time memory to the string to store the increasing number of results ?.

    The vista 64bit machine has been running for 3 hours 40 minutes - still not finished the 6 million loop count with 4 calculations.

    So do i need to change the program or is this an inherent issue with Windows 7 and its behaviour for an intensive iterative program ?.

    Thanks and regards,

    Richard.

    Friday, March 30, 2012 12:32 AM
  • Hi,

    I suggest you post your issue in MSDN forum for further assistance.

    MSDN forum

    http://social.msdn.microsoft.com/Forums/en/categories/


    • Marked as answer by Shadders_X Saturday, March 31, 2012 1:39 PM
    Friday, March 30, 2012 8:24 AM
  • String calculations can be really slow, have you tried simply using an array instead of the string, and then create the string at the end out of the values stored in the array? This may be more memory intensive initially, but you are likely to have less garbage collection and other background activity as the calculation executes.
    • Marked as answer by Shadders_X Saturday, March 31, 2012 1:36 PM
    Friday, March 30, 2012 8:57 PM
  • Hi Mike,

    Thanks. I have implemented an array and this was complete in less than a second for 48 million calculations - it is the string that is taking the time to crete. As bove from another person - i will be visiting the visual studio forum to ask about creating a sring with specific length at run time - have lost of memory - so not an issue for a single on off requirement.

    Thanks and regards,

    Richard.

    Saturday, March 31, 2012 1:36 PM
  • Hi,

    I suggest you post your issue in MSDN forum for further assistance.

    MSDN forum

    http://social.msdn.microsoft.com/Forums/en/categories/



    Hi Ivan,

    Thanks - i need to ask about string creation - specific size before using - as it is the string functions that are excedingly slow.

    Regards,

    Richard.

    Saturday, March 31, 2012 1:39 PM