sundararajan.athijegannathan at oracle.com
Wed Feb 19 19:36:15 PST 2014
Thanks for writing to us.
1) 'rhino' mode uses Rhino's API directly (Context ..). For nashorn, it
uses 'javax.script' engine API. I thought may be on jdk7, I could run
'jre' mode and try jdk7's embedded rhino based javax.script engine.
After clean and re-run test with jdk7 results in
FAILURE: Build failed with an exception.
Build file '/home/sundar/src/citeproc-java/build.gradle' line: 230
* What went wrong:
A problem occurred evaluating root project 'citeproc-java'.
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output.
With jdk8, 'jre' and 'rhino' mode run fine
2) Json handling for rhino uses RhinoJsonBuilder which uses Scriptable
of Rhino. For nashorn, it uses 'string json builder' - which presumably
involves more string handling?
If you can tell me how to run with jdk7, then perhaps we can have proper
comparison. 'jre' mode on jdk7 with rhino javax.script engine and 'jre'
mode on jdk8 with nashorn javax.script engine.
On Wednesday 19 February 2014 09:09 PM, Michel Krämer wrote:
> Hi folks,
> I'm experiencing very drastic performance issues with Nashorn (JDK 8
> b129) compared to Rhino. My script takes almost 13 minutes instead of
> 16 seconds! I hope you guys can tell me what's going on here.
> I've recently tested citeproc-java
> (https://github.com/michel-kraemer/citeproc-java) under JDK8 in order
> to make sure it keeps running flawlessly when the next Java version
> comes out. citeproc-java uses citeproc-js under the hood which is a
> KB, 13.500 lines of code
> well. There is a test suite consisting of 758 tests. Running this
> suite with Oracle Nashorn it takes 12.5 minutes! (see timings below)
> This is a very drastic performance drop and I was very surprised to
> see this. Is there some way to debug Nashorn in order to find out what
> is actually going on here?
> Timings on my computer (i5-3570K, 3.4 GHz, 4 cores, 16 GB RAM):
> 16.176 secs
> 45.970 secs
> Nashorn (JDK 8 b129):
> 754.266 secs
> Steps to reproduce (no prerequisites other than JDK8):
> git clone https://github.com/michel-kraemer/citeproc-java.git
> cd citeproc-java
> ./gradlew runTestSuite -PscriptRunnerType=rhino
> ./gradlew runTestSuite -PscriptRunnerType=jre
More information about the nashorn-dev