>>42
Right, that's why 1 byte datatypes and 4 byte datatypes were faster when allocated outside of a loop. Because it's using 2 registers for 8 byte datatypes.
The measurement was obviously not to indicate the speed, but rather, the difference in speed. Unless you're arguing that your precious context switches account for an almost uniformly 30,000ms difference in only specific datatypes, in which case, IHBT.
The test was by no means strictly scientific, but I wasn't doing anything else at the time. It's sufficient to illustrate the difference in speed. Because the
only thing that changed was the positioning of the variable declaration, it's a safe assumption that the stack allocation makes a difference even in primitives. This difference becomes MUCH larger when you factor complex objects in Sepples.
Your entire argument was that it keeps the variables on the stack for the entire loop execution anyway, which is obviously
not the case in at least some situations with primitives.
Just in case there is still confusion, the content of
>>16:
and the declaration of loop variables makes no difference at all; they are just references to stack space which are the same whether they are in the loop or outside the loop
That's the original argument. That the declaration of loop variables makes no difference at all. Clearly it does
!