Stupidest announcement...

I found out the COPY command is faster than the SET command :stuck_out_tongue: :

set bigList to {}
set numItems to 10000
set t to (time of (current date)) --Start timing operations
repeat with n from 1 to numItems
	copy n to the end of bigList
	-- DON'T DO THE FOLLOWING--it's even slower!
	-- set bigList to bigList & n
end repeat
set total to (time of (current date)) - t --End timing

No you didn’t – try using “set end of bigList to n”.

You found that modifying a list – that’s what “set end of” does – is a lot faster than making a whole new list – which is what “set bigList to bigList & n” does.

I feel wiser after reading this post so it wasn’t stupid at all :slight_smile:

I allways use the end of list construct, because I find it easier to get stuff right that way.

  • Because you don’t create a new list, which can tangle things up.

Best Regards


Oh. :stuck_out_tongue:

Anyways, I got to work on PHP. I’m failing at it. :frowning: