How to improve Script start speed?

A. Sundararajan sundararajan.athijegannathan at
Tue Sep 16 14:56:57 UTC 2014


You may want to try jdk8u20.

It has changes to improve CompiledScript. Also, you may want to try out 
8u40 early access build @


On Tuesday 16 September 2014 07:52 PM, Houtman, Roland wrote:
> Dear Dev,
> I'm using Rhino with JDK1.7u45, which runs really fast.
> Each 500 msec, I run 200 Swingworker instances each executing a small CompiledScript instance with their own SimpleScriptContext.
> The scripts are just 5 lines of javascript-code without a loop.
> Anyway.
> I see a big performance difference with regard to creating a CompiledScript object and calling eval() on it.
> With Rhino it's running immediately at a nice speed.
> But with Nashorn, it takes about 15 seconds for the engine to run stable.
> Pictures I put here on stackoverflow
> The startup-lag is not workable for what we use the scripts for.
> I would appreciate any insight in using Nashorn more optimal.
> ---
> On a sidenote, I also tried running Rhino as separate jar In both Java7 and Java8, as per
> but the JDK1.7u45 embedded version is still about 160x faster than the one provided in ""
> So for Java8, I'm facing some difficulties.
> I'm testing with
> c:\Program Files (x86)\Java\jdk1.8.0\bin>java -version
> java version "1.8.0"
> Java(TM) SE Runtime Environment (build 1.8.0-b132)
> Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode, sharing)
> Kind regards,
> Roland

More information about the nashorn-dev mailing list