Re: Passing *possible* variables to a handler
Re: Passing *possible* variables to a handler
- Subject: Re: Passing *possible* variables to a handler
- From: "Arthur J. Knapp" <email@hidden>
- Date: Thu, 18 Jul 2002 17:30:36 -0400
>
On 7/18/02 12:16 PM, "Arthur J. Knapp" <email@hidden> wrote:
>
>
> First of all, there is the Serge effect, where a script object might be
>
> needed by a handler for only the life of the handler for speeding up access
>
> to list items. Rather than referencing the object directly, one can use
>
> "Nigel" access, giving the script object methods that provide faster access:
Whoops, I can see how I was very unclear here...
>
Are you saying that this "Nigel" method provides even faster access than the
>
straight "Serge" method? by much? Or is it just an alternate way to get this
>
same fast access?
NO, NO, NO... ;-)
We've had this conversation before. Both "Serge" and "Nigel" list-item
access are "equally" faster than simply getting a normal list's item:
set a to {1, 2, 3, 4, 5, 6, 7, 8, 9, etc..., REALLY BIG LIST}
script
property p : a
end
set Serge to result
script
property p : a
on GetAt(x)
return my p's item x
end
end
set Nigel to result
script
property parent : a
on GetAt(x)
return my item x
end
end
set Hamish to result
repeat ( billions of times ) times
-- Equally speedy:
--
set v to Serge's p's item 5 -- script-object's property's item x
set v to Nigel's GetAt(5) -- my property's item x
set v to Hamish's GetAt(5) -- my item x
-- Interesting, but no appearent speed difference:
--
set v to Hamish's item 5
end repeat
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
a r t h u r @ s t e l l a r v i s i o n s . c o m
}
_______________________________________________
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.