Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy might my C# computation time be non-deterministic?
    primarykey
    data
    text
    <p>I am running a search algorithm which is fed at the start with a single seed. From this point on I expect the algorithm to behave in a deterministic fashion, which it largely does. I can largely verify this by looking at the 10,000th step, 20,000 step and seeing they are identical. What I am seeing different though is the length of thread processor time used to get to the same place (having taken identical paths). I am measuring the thread time with ProcessThread.TotalProcessorTime.</p> <p>To quantify this I have done some tests for you. I varied the run time and measured the number of solutions evaluated within this time</p> <hr> <pre><code> 30s 60s 120s 120s 473,962 948,800 1,890,668 1,961,532 477,287 954,335 1,888,955 1,936,974 473,441 953,049 1,895,727 1,960,875 475,606 953,576 1,905,271 1,941,511 473,283 951,390 1,946,729 1,949,231 474,846 954,307 1,840,893 1,939,160 475,052 952,949 1,848,938 1,934,243 476,797 957,179 1,945,426 1,951,542 475,034 476,599 473,831 486,721 1,478 2,426 23,922 11,108 </code></pre> <p>I repeated the test 8 times for each. The bottom two rows show the Average solutions evaluated over a 30 second period followed by the Standard Deviation. I repeated the 120s test as the standard deviation was so high the first time and much lower the second time.</p> <p>If my algorithm is doing the same work then what could cause the same work to take different amounts of time? What random element is being introduced?</p> <p>To clarify a few points:</p> <ol> <li>I am talking about Thread Processor time and not Clock time</li> <li>The algorithm runs on a single thread with no explicit interactions with other threads</li> <li>This environment is Windows XP .Net C# Dual processor</li> <li>It is a console application</li> <li>The algorithm uses the processor and memory, only after it has finished will it print the result to screen. </li> </ol> <p>Best Regards</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.
    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