Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1396565

Summary: Performance issue with nashorn vs rhino in openjdk-1.7.0
Product: Red Hat Enterprise Linux 6 Reporter: Paulo Andrade <pandrade>
Component: java-1.8.0-openjdkAssignee: Roland Westrelin <rwestrel>
Status: CLOSED WONTFIX QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.8CC: jvanek
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-16 08:12:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1397815    
Bug Blocks:    
Attachments:
Description Flags
1.7.0-perf.txt
none
1.8.0-perf.txt none

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.