• 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: Checking on the existence of a file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking on the existence of a file


  • Subject: Re: Checking on the existence of a file
  • From: Shane Stanley <email@hidden>
  • Date: Wed, 05 Dec 2012 09:41:32 +1100

On 05/12/2012, at 1:59 AM, Harald E Brandt <email@hidden> wrote:

> Ahaa! I had the feeling it was somehow accessing a property or instance variable when I omitted the parentheses -- when I timed them the version without parentheses actually ran a couple of microseconds faster, to my surprise. (But actually executing 'valueForKey_("isAbsolutePath")' or 'valueForKey_("absolutePath")' is a bit slower than 'isAbsolutePath()').

I was hoping I'd prompt you to do the timings :-), but they cast doubts on my hypothesis about KVC.

> If I time the different variants in my timer with a 1000-iteration loop, the version with parentheses (isAbsolutePath()) will run at a steady 45 microseconds per iteration, the KVO method (valueForKey_("isAbsolutePath")) will run at a steady 65 microseconds, whereas the version without parentheses (isAbsolutePath) will start off at only 35 microseconds per iteration, but each time I run the loop the time will increase, and after a few runs AppleScriptObjC Explorer 2 will choke and fail with "*** -[ASRunner newPerformer:]: Internal table overflow. (error -2707)". And any new attempt to run will give me "Error compiling script". It must be restarted.

That looks like a pretty standard AppleScript crash it's prompting. Not good, and casts further doubt on my theory.

> (But I could still wish for a bit more consistency in ASObjC, more like the consistency of pure ObjC. And of course, no memory leakage!)

Dreamer ;-)


--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <www.macosxautomation.com/applescript/apps/>


 _______________________________________________
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: Checking on the existence of a file
      • From: Emmanuel LEVY <email@hidden>
References: 
 >Re: Checking on the existence of a file (From: Harald E Brandt <email@hidden>)
 >Re: Checking on the existence of a file (From: Shane Stanley <email@hidden>)
 >Re: Checking on the existence of a file (From: Shane Stanley <email@hidden>)
 >Re: Checking on the existence of a file (From: Harald E Brandt <email@hidden>)
 >Re: Checking on the existence of a file (From: Shane Stanley <email@hidden>)
 >Re: Checking on the existence of a file (From: Harald E Brandt <email@hidden>)
 >Re: Checking on the existence of a file (From: Shane Stanley <email@hidden>)
 >Re: Checking on the existence of a file (From: Harald E Brandt <email@hidden>)

  • Prev by Date: Re: Problem with Help Book
  • Next by Date: Re: Checking on the existence of a file
  • Previous by thread: Re: Checking on the existence of a file
  • Next by thread: Re: Checking on the existence of a file
  • Index(es):
    • Date
    • Thread