Re: "mylist" vs "a reference to" - speed difference
Re: "mylist" vs "a reference to" - speed difference
- Subject: Re: "mylist" vs "a reference to" - speed difference
- From: Malcolm Fitzgerald <email@hidden>
- Date: Fri, 26 Apr 2002 08:59:49 +1000
I hadn't heard about "mylist" as a variant on "a reference to" for dealing
with lists.
However my tests (OSX) suggest it's a lot slower:
The ASLG says, use "my" to refer to objects inside handlers otherwise
applescript will initially treat the object as an undefined local
variable name.
I think you have put the "my" in the wrong spot. Try using this code
and running the test again:
set theList to {}
set isalist to my theList
set list2 to {}
set list3 to a reference to list2
set starttime to current date
repeat 2000 times
-- set end of isaList to "2"
set end of my isalist to "2"
end repeat
set endtime to current date
set twostart to current date
repeat 2000 times
set end of list3 to "2"
end repeat
set twoend to current date
{(endtime - starttime), (twoend - twostart)}
--
--
Malcolm Fitzgerald email@hidden
Database Manager
http://www.asauthors.org
The Australian Society of Authors ph: 02 93180877 fax: 02 93180530
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.