Re: Concatenating records
Re: Concatenating records
- Subject: Re: Concatenating records
- From: Kai <email@hidden>
- Date: Wed, 29 Jan 2003 03:26:12 +0000
on 28/1/03 3:47 pm, Paul Berkowitz at email@hidden wrote:
>
> In all cases, the 'record & new property' method consistently outperformed
>
> the 'new property & record' version. While the precise speed bump could vary
>
> between tests, the average was about 4-5%.
>
>
>
> Not the kind of lead, perhaps, to earn a standing ovation - but probably
>
> significant enough over many records. (Certainly suggests that your
>
> instincts, however lingering, are still to be trusted!) ;-)
>
>
Thanks a lot for checking this, Kai. The script seems quite memory-draining,
>
and will very occasionally time out somewhere (not certain yet if it's on a
>
particular line or note) when there are thousands of items to do, so
>
anything helps. I don't want to add to the burden by switching the order
>
around, so I've done it only in the one place where a previous record
>
property may be revised by a subsequent option, where I put that property on
>
the left. (In some cases, it won't exist yet, so does need to be
>
concatenated rather than merely set.) But I won't change all the other 99
>
properties or so. I'm building up this record so that I can 'make new object
>
with properties {record: here}' all at once, omitting default value
>
properties. The idea was that this should be more efficient than just
>
creating the object and then setting each property with a separate Apple
>
Event.
I imagine that would generally be the case - especially when sending Apple
Events to another app.
>
It still seems to take a lot longer when lots of non-default properties have
>
to be written, even this way as a properties record. One day, I'll check how
>
much time it actually saves, but I'm sure it does save something.
This may not be particularly relevant to the kind of thing you're doing,
Paul - but I just ran a brief comparison using OE as the target app. An
initial script simply made a new outgoing message, and then set four
properties individually. A second version produced the same result, but -
because the four properties were specified within the 'make new outgoing
message' command - did it about 60% faster. (Supports the general principle,
if nothing else.)
>
Thanks a lot for your help.
Well, it wasn't much - but a pleasure, nonetheless.
--
Kai
_______________________________________________
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.