• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "mylist" vs "a reference to" - speed difference
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >"mylist" vs "a reference to" - speed difference (From: "charles" <email@hidden>)

  • Prev by Date: quickmail-check if empty
  • Next by Date: Finder not counting files right
  • Previous by thread: "mylist" vs "a reference to" - speed difference
  • Next by thread: Re: "mylist" vs "a reference to" - speed difference
  • Index(es):
    • Date
    • Thread