• 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: The Case of the Missing Case Statement
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The Case of the Missing Case Statement


  • Subject: Re: The Case of the Missing Case Statement
  • From: "S. J. Cunningham" <email@hidden>
  • Date: Sun, 05 Apr 2015 08:40:55 -0400

On Apr 5, 2015, at 7:57 AM, Shane Stanley wrote:

> On 5 Apr 2015, at 8:17 pm, S. J. Cunningham <email@hidden> wrote:
>>
>> "Just don't worry about it" is not a very satisfying answer to why executing 296K if-then statements takes longer than executing 520K of them.
>
> I tried your code a couple of times, and I get the results the other way round, but with similar slim margins. Changing the order of the tests changed things a bit again, but not much. Timing AppleScript scripts is a bit like that.
>
> But I think the fundamental problem is that for your script to show significant differences, the time taken evaluating the tests would need to be a significant percentage of the overall running time. Whereas you've probably built a test script where the other stuff -- the iteration time, and the time taken to call handlers and then return results -- is taking up so much time, relatively speaking, that the value you're looking for is simply getting lost in the noise.
>
> Which also means don't worry about it :-)

I cut my teeth counting clock cycles many years ago.  It's a hard habit to break :)  I take your point about "being lost in the noise" which is why I tried to make everything else but the IF handlers identical and run a sufficiently large number of cases.  That way small differences should start showing up.  One thing that has occurred to me is that I might be losing any gain to the additional time that the Binary Search takes to make the "greater than" and "less than" comparisons rather than the simple equality of the if-then approach.
 _______________________________________________
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: The Case of the Missing Case Statement
      • From: Shane Stanley <email@hidden>
References: 
 >The Case of the Missing Case Statement (From: "S. J. Cunningham" <email@hidden>)
 >Re: The Case of the Missing Case Statement (From: email@hidden)
 >Re: The Case of the Missing Case Statement (From: email@hidden)
 >Re: The Case of the Missing Case Statement (From: "S. J. Cunningham" <email@hidden>)
 >Re: The Case of the Missing Case Statement (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: The Case of the Missing Case Statement
  • Next by Date: Re: The Case of the Missing Case Statement
  • Previous by thread: Re: The Case of the Missing Case Statement
  • Next by thread: Re: The Case of the Missing Case Statement
  • Index(es):
    • Date
    • Thread