• 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
Re: Manipulate the last item in a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Manipulate the last item in a string


  • Subject: Re: Manipulate the last item in a string
  • From: Emmanuel <email@hidden>
  • Date: Sat, 17 Jun 2006 23:46:26 +0200

At 6:54 PM +0100 6/17/06, kai wrote:
I've found it generally faster (especially in routines that frequently switch the tids value) to use strings.

Indeed, setting the tid to a string is faster than to a list: on my machine, I see a difference on the average of 1 microsecond (7 µs vs 8 µs).


Of course, this is usually peanuts, as the fastest "text items" that I can run requires 60 µs.

This is on a PowerBook G4. I have observed that some commands are very differently fast on PowerBook vs Intel, so if anyone wants to provide timings on an Intel machine, here is the code (for Smile.)

------------
chrono
repeat 10000 times
	set AppleScript's text item delimiters to {"	"}
end repeat
quietmsg("" & (round chrono * 100) & " µs") -- 8 or 9 µs

chrono
repeat 10000 times
	set AppleScript's text item delimiters to "	"
end repeat
quietmsg("" & (round chrono * 100) & " µs") -- 7 or 8 µs

chrono
repeat 10000 times
	text items of "hello world"
end repeat
quietmsg("" & (round chrono * 100) & " µs") -- 60 or 61 µs
-------------

Emmanuel

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Manipulate the last item in a string (From: Marine Themes <email@hidden>)
 >Re: Manipulate the last item in a string (From: kai <email@hidden>)
 >Re: Manipulate the last item in a string (From: Yvan KOENIG <email@hidden>)
 >Re: Manipulate the last item in a string (From: kai <email@hidden>)

  • Prev by Date: Re: Manipulate the last item in a string
  • Next by Date: Apple Script Needed for InDesign CS2 Tables
  • Previous by thread: Re: Manipulate the last item in a string
  • Next by thread: Re: Manipulate the last item in a string
  • Index(es):
    • Date
    • Thread