• 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
Concatenating records
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Concatenating records
      • From: Ben Waldie (AppleScript Guru) <email@hidden>
  • Prev by Date: Re: [OT] AppleScript scripts versus Shell scripts
  • Next by Date: Re: PS7, Resizing according to image orientation
  • Previous by thread: Hiding the modifier keys when stuffing keystrokes
  • Next by thread: Re: Concatenating records
  • Index(es):
    • Date
    • Thread