• 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: AppleScriptObjC -- List Folder Handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScriptObjC -- List Folder Handler


  • Subject: Re: AppleScriptObjC -- List Folder Handler
  • From: Nigel Garvey <email@hidden>
  • Date: Sun, 02 Dec 2018 11:19:26 +0000

Shane Stanley wrote on Sun, 02 Dec 2018 12:38:43 +1100:

>On 2 Dec 2018, at 11:42 am, Nigel Garvey <email@hidden> wrote:
>
>> It can be speeded up considerably for large folders by fetching the
>keys with
>> the URLs
>
>Maybe our definitions of large differ, but my tests with about 150 items
>only showed a difference of maybe 10%, if that. Worth taking, sure, but
>I don't know that I'd call it considerable.

The test folder I used last night contains 6592 items. Pitting both
versions of the handler against this, in Script Debugger and with my own
timing inserts to double-check SD's figures, my version's about twice as
fast as the original, knocking about a second off the time! However, my
machine does usually have BOINC tasks running in the background. With
these suspended, the handler timings are shorter, but proportionally
similar.

Running the tests again this morning in both Script Debugger and Script
Editor, I'm finding that with the 6592-item folder and with BOINC
running, all versions of the handler are reliably faster in SE than in
SD. Otherwise, with a smaller folder and/or with BOINC suspended,
they're faster in SD.  :\

>Mind you, timing this stuff is tricky because of OS caching.

!

>> and a bit more by building theNames as an NSMutableArray:
>
>Interestingly that's slower here, which matches my recollection of using
>NSMutableArray instead of a list. How big is your test folder? Maybe
>that comes into play.

I'm finding it slightly slower too when there are only 129 items in the
folder, but by a lesser amount than it is faster with 6592 items. I
theorise that although it may take longer to build an NSMutableArray
than to build a list, there comes a point where the number of individual
NSString-to-text coercions required with the latter tips the balance the
other way.

Actual timings vary from run to run, but here are some typical results
(in seconds) I've obtained this morning.

                              In SD    In SE

BOINC running

6592 items:
Original handler              2.386    1.855
Local name fetch with URLs    1.582    1.356
Ditto & mutable array         1.101    1.051

129 items:
Original handler              0.027    0.031
Local name fetch with URLs    0.017    0.021
Ditto & mutable array         0.02     0.025


BOINC suspended

6592 items:
Original handler              1.622    1.753
Local name fetch with URLs    1.165    1.275
Ditto & mutable array         0.817    1.006

129 items:
Original handler              0.025    0.03
Local name fetch with URLs    0.016    0.021
Ditto & mutable array         0.02     0.024


NG

 _______________________________________________
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: AppleScriptObjC -- List Folder Handler
      • From: Nigel Garvey <email@hidden>
    • Re: AppleScriptObjC -- List Folder Handler
      • From: Shane Stanley <email@hidden>
References: 
 >Re: AppleScriptObjC -- List Folder Handler (From: Nigel Garvey <email@hidden>)

  • Prev by Date: Re: AppleScriptObjC -- List Folder Handler
  • Next by Date: Re: AppleScriptObjC -- List Folder Handler
  • Previous by thread: Re: AppleScriptObjC -- List Folder Handler
  • Next by thread: Re: AppleScriptObjC -- List Folder Handler
  • Index(es):
    • Date
    • Thread