• 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: Passing *possible* variables to a handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing *possible* variables to a handler


  • Subject: Re: Passing *possible* variables to a handler
  • From: Christopher Nebel <email@hidden>
  • Date: Tue, 16 Jul 2002 17:26:06 -0700

On Tuesday, July 16, 2002, at 12:03 PM, has wrote:

Chris N explained a while back that it's reallocated for every 16 items added; each time adding enough extra room for another 16 items before. Which got me wondering: why doesn't
AS allocate twice as much extra space that was previously allocated, trading some memory efficiency for improved speed?

I think the reason is that in the days of the Founders [1], your average Mac only had 2MB of RAM and no virtual memory. They were therefore very conservative in how they used memory, and a lot of those decisions are still with us. I do plan at some point to switch to a doubling scheme, which gets you list inserts in what's known as "amortized constant" time. The idea is that while a given operation might take O(n) time, most of them are O(1), and the O(n)s are spaced out such that it averages out to O(1).


--Chris Nebel
AppleScript Engineering

[1] Dealing with AppleScript, like any sufficiently old software project, resembles Constitutional law. When you don't have access to the original authors (none of the AppleScript founders are dead, but neither do they work at Apple any more, and it was 10-12 years ago now), you find yourself debating what it was they actually intended to do.
_______________________________________________
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: 
 >Re: Passing *possible* variables to a handler (From: has <email@hidden>)

  • Prev by Date: Re: Properties of junked script objects persist if referenced
  • Next by Date: Re: script to delete files based on date in file name
  • Previous by thread: Re: Passing *possible* variables to a handler
  • Next by thread: Re: Passing *possible* variables to a handler
  • Index(es):
    • Date
    • Thread