Re: Passing *possible* variables to a handler
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.