Javascript compile/execute performance in Spidermonkey

View: New views
5 Messages — Rating Filter:   Alert me  

Javascript compile/execute performance in Spidermonkey

by Rajesh N-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
 
We are developing a moderately complex software application for server based
systems, embedding Spidermonkey Engine (JS 1.5) for internal Javascript
processing. We are currently facing performance issues with our application.
Detailed analysis (through Quantify-based profiling) shows a substantial CPU
usage contribution by the Spidermonkey APIs (paricularly
JS_EvaluateUCScriptForPrincipals). It may also be noted that other software
modules including system service functions too contribute in small/moderate
extent.
 
Over a period of time, we have redesigned parts of our software application
to optimally use Javascript, whereby we have moved from a "evaluate whenever
required" to "compile-once and execute whenever required". Still, there is a
considerable set of internal software constructs where we are forced to use
the "evaluate" API.
 
We would like to know whether the Spidermonkey engine code, during its
migration from 1.5 to 1.8 (as available in the Mozilla 3.0 trunk) has
incorporated any important code changes that improve the performance of
"compile & execute" or "evaluate script" functionalities. Kindly provide
inputs in this direction, so that we can think of steps to address this
issue.
 
Specifically, our comparison analysis of JS1.5 vs JS1.8 has shown that, in
our usage, CompileScript has dropped in performance in JS 1.8, and
ExecuteScript has jumped in performance. This trend seems to be different
from benchmarks for Firefox (including beta) versions, which has reported
improved Javascript performance over its prior releases.
 
Thanks
Rajesh
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

Parent Message unknown Re: Javascript compile/execute performance in Spidermonkey

by Robert Sayre-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jul 18, 6:00 am, Rajesh N <raje...@...> wrote:
>
> Specifically, our comparison analysis of JS1.5 vs JS1.8 has shown that, in
> our usage, CompileScript has dropped in performance in JS 1.8, and
> ExecuteScript has jumped in performance. This trend seems to be different
> from benchmarks for Firefox (including beta) versions, which has reported
> improved Javascript performance over its prior releases.

Hi Rajesh,

Could you attach test cases that show the performance problem you're
seeing?

thanks,
Rob
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

RE: Javascript compile/execute performance in Spidermonkey

by Rajesh N-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Rob/All,

The test case basically consists of simple invocation of a set of JS API
functions to realize certain definitive requirements of the software.

Primary set of opertations include (a) creation of simple/composite
variables with defined values, (b) updation of these variables at runtime,
(c) evaluation of Javascript expressions (executable/conditional/iterative
etc).

Please note that the details provided below compare our observations with
JS1.5 and JS1.7 (and not JS 1.8 as I had menioned in my first mail).

The performance measurement takes into account, both the compile and execute
calls to JS. The overall gain is not reflected when we replace Spidermonkey
1.5 with 1.7.  We feel that the direction for speed optimization of
Spidermonkey is to towards making execution faster but not compilation, and
we also noted that there is dip in
performance of compilation time from 1.5 to 1.7.

For our use case, the Compile:Execute time ratio in JS 1.5 is 7:3 whereas in
JS 1.7, it is 9:1

We would like to know whether our analysis of the composite performance
results is in the same lines as how the speed optimization related
modifications in Spidermonkey 1.7

Any pointers towards how differently we can analyze this situation, could
also help.

Thanks
Rajesh

-----Original Message-----
From: dev-tech-js-engine-bounces+rajeshn=huawei.com@...
[mailto:dev-tech-js-engine-bounces+rajeshn=huawei.com@...] On
Behalf Of sayrer
Sent: Saturday, July 19, 2008 12:04 AM
To: dev-tech-js-engine@...
Subject: Re: Javascript compile/execute performance in Spidermonkey

On Jul 18, 6:00 am, Rajesh N <raje...@...> wrote:
>
> Specifically, our comparison analysis of JS1.5 vs JS1.8 has shown
> that, in our usage, CompileScript has dropped in performance in JS
> 1.8, and ExecuteScript has jumped in performance. This trend seems to
> be different from benchmarks for Firefox (including beta) versions,
> which has reported improved Javascript performance over its prior
releases.

Hi Rajesh,

Could you attach test cases that show the performance problem you're seeing?

thanks,
Rob
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

Re: Javascript compile/execute performance in Spidermonkey

by Mike Shaver :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Jul 21, 2008 at 1:56 AM, Rajesh N <rajeshn@...> wrote:
> The test case basically consists of simple invocation of a set of JS API
> functions to realize certain definitive requirements of the software.

The details of the cases are important for analysis; without seeing
representative source, it's hard to give good advice, or for us to
improve compilation behaviour for your specific needs.

> We feel that the direction for speed optimization of
> Spidermonkey is to towards making execution faster but not compilation, and
> we also noted that there is dip in
> performance of compilation time from 1.5 to 1.7.

There was at least one problem with compilation of certain patterns of
top-level script (large top-level if blocks, f.e.) that was remedied
in JS 1.8.  You might try using the latest source from Mozilla CVS to
see if that improves matters for you.

We certainly care about compilation performance, as much web script is
executed only once.

> Any pointers towards how differently we can analyze this situation, could
> also help.

When profiling your application, what does the breakdown of time spent
in compilation look like?  Can you provide an example of the source
that has become slower to compile, if that performance loss is still
present with Mozilla CVS?

Mike
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

Re: Javascript compile/execute performance in Spidermonkey

by Daniel Romero :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi.

I have done several tests to spidermonkey and I have some GC issues at
the moment: GC's sweep phase takes too long some times, and if you
create multiple Runtimes, the things goes much worst.

May be that is your problem, or is only excessive CPU usage?

Regards,
DR

2008/7/21 Rajesh N <rajeshn@...>:

> Hi Rob/All,
>
> The test case basically consists of simple invocation of a set of JS API
> functions to realize certain definitive requirements of the software.
>
> Primary set of opertations include (a) creation of simple/composite
> variables with defined values, (b) updation of these variables at runtime,
> (c) evaluation of Javascript expressions (executable/conditional/iterative
> etc).
>
> Please note that the details provided below compare our observations with
> JS1.5 and JS1.7 (and not JS 1.8 as I had menioned in my first mail).
>
> The performance measurement takes into account, both the compile and execute
> calls to JS. The overall gain is not reflected when we replace Spidermonkey
> 1.5 with 1.7.  We feel that the direction for speed optimization of
> Spidermonkey is to towards making execution faster but not compilation, and
> we also noted that there is dip in
> performance of compilation time from 1.5 to 1.7.
>
> For our use case, the Compile:Execute time ratio in JS 1.5 is 7:3 whereas in
> JS 1.7, it is 9:1
>
> We would like to know whether our analysis of the composite performance
> results is in the same lines as how the speed optimization related
> modifications in Spidermonkey 1.7
>
> Any pointers towards how differently we can analyze this situation, could
> also help.
>
> Thanks
> Rajesh
>
> -----Original Message-----
> From: dev-tech-js-engine-bounces+rajeshn=huawei.com@...
> [mailto:dev-tech-js-engine-bounces+rajeshn=huawei.com@...] On
> Behalf Of sayrer
> Sent: Saturday, July 19, 2008 12:04 AM
> To: dev-tech-js-engine@...
> Subject: Re: Javascript compile/execute performance in Spidermonkey
>
> On Jul 18, 6:00 am, Rajesh N <raje...@...> wrote:
>>
>> Specifically, our comparison analysis of JS1.5 vs JS1.8 has shown
>> that, in our usage, CompileScript has dropped in performance in JS
>> 1.8, and ExecuteScript has jumped in performance. This trend seems to
>> be different from benchmarks for Firefox (including beta) versions,
>> which has reported improved Javascript performance over its prior
> releases.
>
> Hi Rajesh,
>
> Could you attach test cases that show the performance problem you're seeing?
>
> thanks,
> Rob
> _______________________________________________
> dev-tech-js-engine mailing list
> dev-tech-js-engine@...
> https://lists.mozilla.org/listinfo/dev-tech-js-engine
>
> _______________________________________________
> dev-tech-js-engine mailing list
> dev-tech-js-engine@...
> https://lists.mozilla.org/listinfo/dev-tech-js-engine
>



--
Atte.
Daniel Romero Peña
Ingeniero Investigador
NICLabs
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine
LightInTheBox - Buy quality products at wholesale price