• 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: Memory tests
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory tests


  • Subject: Re: Memory tests
  • From: Richard Morton <email@hidden>
  • Date: Fri, 19 Mar 2004 12:40:24 +1100

On 19 Mar 2004, at 11:16 AM, Nelson Byrne wrote:

1) What's the difference between these two lists?

[a,b,c] and (a,b,c)

Umm, one of them is not a list. ;-)


2) What is the "best type"? ... or was it "best class"?

There have been discussions over the years on the relative merits of the vector list:

["textItem", 42, someVariable]

Versus the other, standard, type whose name I can't remember:

{"textItem", 42, someVariable}

I think the general consensus is that the differences are irrelevant for most purposes. Another way of putting it is that if you're needing to optimise something, there are other things that will benefit you more.

For example, when adding to a list, use this:

set the end of myList to myNewItem

Rather than this:

set myList to myList & myNewItem

Items can be added to the beginning of a list as well. The preferred method is considerably more memory efficient.

Operations involving lists containing many items - say in the hundreds - can get very slow. The "Serge Method" (which I don't have a simple example of at hand) can be used here and has been discussed a number of times on this list. I know Nigel Garvey has posted some good stuff on it. An archive search may locate it, or someone may have an example they can post. The break even point OMM is about 20 items but it still doesn't always make it worthwhile. For me anyway. If you expect to be regularly dealing with lists of 50 or more items *and* the list operation is a bottleneck, it's definitely worth using.

Cheers,

Float N Point
-- If a point floats in the forest... Never mind...
_______________________________________________
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: 
 >Memory tests (From: Nelson Byrne <email@hidden>)

  • Prev by Date: Re: Memory tests
  • Next by Date: Re: Memory tests
  • Previous by thread: Re: Memory tests
  • Next by thread: Re: Memory tests
  • Index(es):
    • Date
    • Thread