|
-
Feb 18th, 2009, 05:16 AM
#11
Re: One Line or Two Lines?
 Originally Posted by SJWhiteley
I mean multiply your inner loop by 10, so you are running it for half a minute or so per loop.
Basically, if it takes 3800ms for loop 1 and 3700 for loop 2, what would be the results for 1x the number of loops. We will get:
Loop One: 38000 ms
Loop Two: 37000 ms (1 second difference)
or:
Loop One: 38000 ms
Loop Tow: 37900 ms (still a 100ms difference)
or, something else.
Personally, I don't get the same results as you at all - the results are all within 10mS or so on my PC, so don't see a problem.
Obviously, you do see a difference; the IL and assembly code would contradict your evidence, so we'd have to determine a pattern for the results to see if there's potentially another reason for the discrepancy.
Multiplied the inner loops by 10 (increased one zero). Here are the results now:
Code:
One Line : 36727
Two Lines: 36702
One Line : 36713
Two Lines: 36713
One Line : 36714
Two Lines: 36709
The thread 0x17c has exited with code 0 (0x0).
One Line : 36702
Two Lines: 36708
One Line : 36700
Two Lines: 36707
One Line : 36704
Two Lines: 36702
One Line : 36699
Two Lines: 36708
One Line : 36711
Two Lines: 36705
One Line : 36737
Two Lines: 36718
One Line : 36709
Two Lines: 36716
Amazingly the difference seems to be reducing instead of increasing
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|