Share context/JS bindings

Axel Dörfler axeld at pinc-software.de
Wed Jun 15 09:24:44 UTC 2016


Am 14.06.2016 um 22:09 schrieb Tony Zakula:
> Interesting.  We use on global context and create a new engine context
> with each run.  The initial compile of several scripts is over 100ms,
> but then we see that drop to under 10ms.  The context creation seems to
> have very little overhead.  We have not timed that specifically though,
> just total process time.

In my special use case which was a very short JavaScript that was used 
as Comparator, actual execution time was very short, so the impact of 
the optimizations were pretty obvious.
Sorting about 15000 entries took way over 10 minutes before any 
optimization. IIRC after using a single global engine this dropped to 
about 2 minutes. After also reusing the JS context, it went down to 10 
seconds.

Bye,
    Axel.



More information about the nashorn-dev mailing list