Re: Manipulate the last item in a string
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