Interesting -- I'm not terribly familiar with list generation: I've played with Python, so I know it's a thing, but LiveCode has nothing like it built in, and I would never do something like
repeat with i = 1 to 1000000
put i,"" after aList
end repeat
repeat for each item i in aList
-- do something
end repeat
I just checked and found that the while loop was even slower :-)
I'm not sure this accomplishes the same task, albeit that the task is synthetic in the first place, but in any case, this is about 20x faster:
on click do range 10000000 alert["Done!"] end