• 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: processing time & stack overflow!!!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: processing time & stack overflow!!!


  • Subject: Re: processing time & stack overflow!!!
  • From: Jon Pugh <email@hidden>
  • Date: Fri, 31 Aug 2001 09:47:10 -0700

At 8:03 AM -0400 8/31/2001, Victor Yee wrote:
>Now, this is something that I use but don't really fully understand, so I'm the wrong guy to answer. But it seems that when manipulating lists, the "reference to" construct will save considerable amounts of processing.

Specifically, it avoids copying the data, which in this case is really big, so the more times you can avoid that, the better.

Good:

set bobs to {"Robert", "Bob", "Dick", "John", "Ralph", "Bud"}
set item 6 of bobs to "Henry" -- changes item 6 only

Bad:

set bobs to {"Robert", "Bob", "Dick", "John", "Ralph", "Bud"}
set bobs to (items 1 thru -2 of bobs) & "Henry" -- copies bobs & makes new bobs

Copying is the primary thing that computers do, and we need to do less of it. ;)

Jon


References: 
 >Re: processing time & stack overflow!!! (From: Victor Yee <email@hidden>)

  • Prev by Date: Re: applescript-users digest, Vol 2 #1019 - 12 msgs
  • Next by Date: Re: processing time & stack overflow!!!
  • Previous by thread: Re: processing time & stack overflow!!!
  • Next by thread: Re: processing time & stack overflow!!!
  • Index(es):
    • Date
    • Thread