• 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: A question on technique
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A question on technique


  • Subject: Re: A question on technique
  • From: "Stockly, Ed" <email@hidden>
  • Date: Tue, 17 Mar 2015 14:54:42 +0000
  • Thread-topic: A question on technique

On Mar 16, 2015, at 8:18pm, Shane Stanley <email@hidden> wrote:
>
> It might scale well, but it's still much, much slower.
>
> Here's a script that times several of the methods posted. It uses a list of 300 items, with only the last one matching. It requires Yosemite for the ASObjC version and timing, and it should be run as an applet, because editors skew results (as, probably, does using a large number of iterations). Results are in milliseconds.
>

There’s an extra command in the handler for Chris’ TID approach that probably slows it down considerably. (see below)

I ran a version of this with my handler; the one below (which takes a nearly identical approach; and the OSAX and TIDs were consistently faster. (once I removed the extra command from Chris’).

Couldn’t test Shane’s version here, and I’m using seconds, with 10000 iterations do get meaningful results.

on lookupMnemonic(_mnemoic)
	set {oldTIDS, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {_mnemoic & tab}}
	—>>	text items of lookupTable <<— not needed
	set _output to paragraph 1 of text item 2 of lookupTable
	set AppleScript's text item delimiters to oldTIDS
	return _output
end lookupMnemonic



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden


  • Follow-Ups:
    • Re: A question on technique
      • From: Christopher Stone <email@hidden>
References: 
 >Re: A question on technique (From: Olof Hellman <email@hidden>)
 >Re: A question on technique (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: A question on technique
  • Next by Date: Re: A question on technique
  • Previous by thread: Re: A question on technique
  • Next by thread: Re: A question on technique
  • Index(es):
    • Date
    • Thread