• 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: JSA -- now I believe this is a bug (JSA or AS)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JSA -- now I believe this is a bug (JSA or AS)


  • Subject: Re: JSA -- now I believe this is a bug (JSA or AS)
  • From: Emmanuel LEVY <email@hidden>
  • Date: Thu, 18 Dec 2014 10:09:42 +0100

[ Sorry I made a typo, please discard my previous mail ]


FWIW, you can use Javascript from Smile, I mean if you're in a hurry  :-)

Indeed, JS in incredibly fast compared to AS, look:

----
callJavaScript ww script "var i, x=0 ; for ( i = 0 ; i < 1000000 ; i++ ) x += Math.tan ( 1 ) ; x" [1]
----
runs in 0.08 second! Or, 0.08 microsecond per iteration. (The final "x" is to make sure some optimization process is not skipping the whole computation, considering no-one needs the result!) This is on a 2Ghz clocked machine.

This is 9 times faster than 1,000,000 simple additions in AS:

----
set x to 0
repeat 1000000 times
	set x to x + 1
end repeat
----

And 40 times faster than the same program in AS - with an OSAX call:

----
set x to 0
repeat 1000000 times
	set x to x + (tan (1))
end repeat
----

Emmanuel


[1] First you have to run, once for all: set ww to make new web window, in order to provide a context to JS.


On Dec 18, 2014, at 6:30 AM, Deivy Petrescu wrote:

>
>> On Dec 18, 2014, at 24:20 , Shane Stanley <email@hidden> wrote:
>>
>> On 18 Dec 2014, at 3:58 pm, Deivy Petrescu <email@hidden> wrote:
>>>
>>> So was mine! That is running run script in JS.
>>
>> That's not the same thing as calling "run script" from AppleScript.
>
> Yes, it is, in JSA is “runScript”.
>
> It would be simpler to run something like
>
> run script "Math.cos(x)” as “JS”
>
>
>>
>> --
>> Shane Stanley <email@hidden>
>
> Deivy Petrescu
> email@hidden
>
>
> _______________________________________________
> 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


_______________________________________________
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
 _______________________________________________
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: JSA -- now I believe this is a bug (JSA or AS)
      • From: Shane Stanley <email@hidden>
References: 
 >JSA -- now I believe this is a bug (JSA or AS) (From: Deivy Petrescu <email@hidden>)
 >Re: JSA -- now I believe this is a bug (JSA or AS) (From: Shane Stanley <email@hidden>)
 >Re: JSA -- now I believe this is a bug (JSA or AS) (From: Deivy Petrescu <email@hidden>)
 >Re: JSA -- now I believe this is a bug (JSA or AS) (From: Shane Stanley <email@hidden>)
 >Re: JSA -- now I believe this is a bug (JSA or AS) (From: Deivy Petrescu <email@hidden>)
 >Re: JSA -- now I believe this is a bug (JSA or AS) (From: Shane Stanley <email@hidden>)
 >Re: JSA -- now I believe this is a bug (JSA or AS) (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: Re: JSA -- now I believe this is a bug (JSA or AS)
  • Next by Date: odd Numbers's behaviour
  • Previous by thread: Re: JSA -- now I believe this is a bug (JSA or AS)
  • Next by thread: Re: JSA -- now I believe this is a bug (JSA or AS)
  • Index(es):
    • Date
    • Thread