Bug 1396565 - Performance issue with nashorn vs rhino in openjdk-1.7.0
Summary: Performance issue with nashorn vs rhino in openjdk-1.7.0
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: java-1.8.0-openjdk
Version: 6.8
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Roland Westrelin
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On: 1397815
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-18 16:05 UTC by Paulo Andrade
Modified: 2020-01-17 16:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-16 08:12:58 UTC
Target Upstream Version:


Attachments (Terms of Use)
1.7.0-perf.txt (3.06 MB, text/plain)
2016-11-18 16:07 UTC, Paulo Andrade
no flags Details
1.8.0-perf.txt (13.76 MB, text/plain)
2016-11-18 16:11 UTC, Paulo Andrade
no flags Details

Description Paulo Andrade 2016-11-18 16:05:21 UTC
User has an environment that creates JavaScript "rules" and
executes them. It was noticed that with java-1.7.0-openjdk
using rhino it runs almost 20 times faster.

  A similar bug report to upstream exists at
https://bugs.openjdk.java.net/browse/JDK-8034959

[more information follow]

Comment 1 Paulo Andrade 2016-11-18 16:07:55 UTC
Created attachment 1221905 [details]
1.7.0-perf.txt

Sample perf output when running with java-1.7.0-openjdk (rhino)

Comment 2 Paulo Andrade 2016-11-18 16:11:25 UTC
Created attachment 1221907 [details]
1.8.0-perf.txt

Sample perf output when run with java-1.8.0-openjdk (nashorn)

Comment 7 Roland Westrelin 2016-11-21 10:38:55 UTC
User's test creates new short lived javascript functions that are executed in a loop. Nashorn is not designed to handle such workload efficiently: each new function is compiled to bytecodes so with nashorn a big part of this test's execution is spent spinning bytecodes. As pointed above this is a known issue upstream and it seems the recommendation is to use rhino with jdk 8:

https://wiki.openjdk.java.net/display/Nashorn/Using+Rhino+JSR-223+engine+with+JDK8

Comment 8 Paulo Andrade 2016-11-21 11:58:53 UTC
Should, or does rhel 6 and 7, already have a package with rhino ready
to use with jdk 8?

Comment 9 Paulo Andrade 2016-11-22 11:50:39 UTC
  Replying to myself, and adding needinfo.

https://admin.fedoraproject.org/pkgdb/package/rpms/rhino/

needs epel6 and epel7 branches, or, a rhel package. Should also update
to Rhino 1.7.7.1 released February 2, 2016.

Comment 10 Paulo Andrade 2016-12-05 12:35:20 UTC
Please ignore the request for rhino epel branch.
For some reason I did not find it was in rhel already.
So, the solution currently should be to use rhel rhino and
procedures described at
https://wiki.openjdk.java.net/display/Nashorn/Using+Rhino+JSR-223+engine+with+JDK8

Comment 11 Roland Westrelin 2016-12-15 12:33:17 UTC
Paulo: is there anything any more you need from us? Should we close that bug now that there's a workaround?

Comment 12 Paulo Andrade 2016-12-15 12:39:16 UTC
  Hi Roland,

  Yes, the bug can be closed. May thanks for your help.


Note You need to log in before you can comment on or make changes to this bug.