Concatenating records
Concatenating records
- Subject: Concatenating records
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 27 Jan 2003 00:43:21 -0800
If I'm building up a record by concatenating a new property (label and
value) to it, one by one, until I reach perhaps 100 properties, will it be
more efficient memory-wise if I concatenate the new property to the end:
set theRecord to theRecord & {newProperty:"New"}
than if I do it the other way around:
set theRecord to {newProperty:"New"} & theRecord
?
I would only do this if I can be absolutely certain that the record does not
already contain a newProperty, of course, since otherwise nothing will be
replaced (left side rules in concatenation). "Just to be safe", I might do
it with newProperty on the left in _all_ cases, but I have a lingering
instinct, which is probably not rational, that concatenating a record on the
left that contains, say, 88 properties with a record on the right that
contains 1 property somehow involves less memory re-writing than the other
way around. This is probably silly, but I really don't know. Does anyone
know for certain?
I may be building up this 100-item record 3000+ times, so it would add up if
there were any difference.
--
Paul Berkowitz
_______________________________________________
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.