> And please: post the results of your tests!
> 
Some more results--it appears to be a triple-nested loop with two of the
loops "loop with" and one "loop while".

on test6
  
  ms = the milliseconds
  
  a = 0
  
  repeat while a < 10000
    repeat with i = 0 to 99
      repeat with j = 0 to 4
        nothing
      end repeat
    end repeat
    a = a + 1
  end repeat
  
  put the milliseconds - ms
  
  put i & " / " & j & " / " & a
  
end 

on test7
  
  ms = the milliseconds
  
  a = 0
  i = 0
  
  repeat while a < 10000
    repeat while i < 100
      repeat with j = 0 to 4
        nothing
      end repeat
      i = i + 1
    end repeat
    a = a + 1
  end repeat
  
  put the milliseconds - ms
  
  put i & " / " & j & " / " & a
  
end 

test6
-- 10572
-- "100 / 5 / 10000"

test7
-- 15
-- "100 / 5 / 10000"

Very interesting. I wonder what's going on under the hood. If I did the
equivalent in assembler, I would use a register variable for the
equivalent of a "loop with", and it would be much faster than the "loop
while." At least on Intel chips--they have a special register for loops,
and an assembly-language operator the allows the loop incrementing to be
done in hardware. That doesn't seem to be going on here, though.

Cordially,

Kerry Thompson
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to