JSCocoa performance

12 views
Skip to first unread message

Max_B

unread,
Jul 21, 2009, 11:52:13 AM7/21/09
to JSCocoa
Hello there,
I just made a first tour of the doc and examples. Did not try it yet.
I'd like to know if anyone has some performance info/comparison.
If JSCocoa is to be used as a main language for an App, or a
consistent module, its code is interpreted, right? Then, its speed is
like JS running in Webkit? Or better? Or what?

WebKit is fast on JS, but I have no figure to compare native compiled
ObjC vs. JS through JavascriptCore.

Thanks

Patrick Geiller

unread,
Jul 21, 2009, 12:17:23 PM7/21/09
to jsc...@googlegroups.com

Hi Max,

> Hello there,
> I just made a first tour of the doc and examples. Did not try it yet.
> I'd like to know if anyone has some performance info/comparison.
> If JSCocoa is to be used as a main language for an App, or a
> consistent module, its code is interpreted, right? Then, its speed is
> like JS running in Webkit? Or better? Or what?

I have no benchmark figures.

JSCocoa is just a few custom JavascriptCore objects running in a
standard Javascript context, like Safari. Every time you access an
ObjC object, there is some data conversion (boxing and unboxing)
between ObjC and Javascript. This means the less often you use ObjC,
the closer you'll match Webkit speed.

Regarding the intrepreted code - it's interpreted if you're running
Safari 3. In Safari 4, code is compiled at runtime, just like in
Safari. You'll never be faster than JavascriptCore, only a bit slower.

-Patrick

Max_B

unread,
Jul 21, 2009, 12:31:34 PM7/21/09
to JSCocoa


On 21 juil, 18:17, Patrick Geiller <parman...@gmail.com> wrote:
> I have no benchmark figures.
> >
> Regarding the intrepreted code - it's interpreted if you're running  
> Safari 3. In Safari 4, code is compiled at runtime, just like in  
> Safari. You'll never be faster than JavascriptCore, only a bit slower.
>
> -Patrick

Boxing-unboxing should not be great deal. You answered my question, I
was not sure if the JS compilation depend on JavascriptCore or WebKit
framework.
Now how fast is compiled JS vs. compiled ObjC is not a JSCocoa issue,
fore sure.
Nevertheless I'd like to figure it out before jumping in.

Gus Mueller

unread,
Jul 21, 2009, 1:04:17 PM7/21/09
to jsc...@googlegroups.com
On Jul 21, 2009, at 9:31 AM, Max_B wrote:

> Now how fast is compiled JS vs. compiled ObjC is not a JSCocoa issue,
> fore sure.
> Nevertheless I'd like to figure it out before jumping in.


The only way you're going to find this out, is to try it out.

Each app has it's own performance problems. The best thing to do is
just to come up with a proof of concept of what you think would be the
bottleneck, and judge for yourself if it's fast enough.

-gus

--

August 'Gus' Mueller
Flying Meat Inc.
http://flyingmeat.com/

Reply all
Reply to author
Forward
0 new messages