Speed anomaly?
Posted: Fri Nov 06, 2020 2:47 pm
This test handler came from another thread, comparing the relative speed between "if-then" and "switch. It was determined that "if-then" was a few percent faster. Now I find that running this gives very different results after several tries. Sometimes "if-then" is twice as fast, sometimes half as fast. Sometimes they are relatively equal, but at very different mutual speeds.
One has to have five minutes with nothing to do to even bother, but on a card with a two line field "x'" and this in a button script:
After several runs I get things falling into four groups, typified by these examples:
"350/170"
"200/175"
"199/346"
"367/341"
All over the place, with 2:1 range. Do I just assume that other processes in the machine are using resources here and there that trip up the repeat portions of this handler, sometimes in the "if-then" section, and sometimes in the "switch" section? But the results are not scattered; they fall into just four ranges. So that does not sound like the reason.
Anyone else with lots of free time see this same small set of results?
Is there a way to lock out every process but LC, to the extent that such a thing can be done? Would it even out the handler? Would it speed up LC overall?
Craig
One has to have five minutes with nothing to do to even bother, but on a card with a two line field "x'" and this in a button script:
Code: Select all
on mouseup
put "" into fld "x"
put random(99) into temp
put the ticks into tStart
repeat 10000000
switch
case temp mod 2 = 0
break
case temp mod 2 = 1
break
end switch
end repeat
put the ticks - tStart into fld "x"
put random(99) into temp
put the ticks into tStart
repeat 10000000
if temp mod 2 = 0 then
else if temp mod 2 = 1 then
end if
end repeat
put the ticks - tStart into line 2 of fld "x"
end mouseup
"350/170"
"200/175"
"199/346"
"367/341"
All over the place, with 2:1 range. Do I just assume that other processes in the machine are using resources here and there that trip up the repeat portions of this handler, sometimes in the "if-then" section, and sometimes in the "switch" section? But the results are not scattered; they fall into just four ranges. So that does not sound like the reason.
Anyone else with lots of free time see this same small set of results?
Is there a way to lock out every process but LC, to the extent that such a thing can be done? Would it even out the handler? Would it speed up LC overall?
Craig