Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8034959

one line javascript scripts are 5 times slower in nashorn vs rhino

XMLWordPrintable


      Have taken a program that calls internally the javascript engine, traced all its calls, and built a program that does all of them. i.e. built a program whose task is to make only a long list of javascript engine invokations.

      Compiled and run it with java7, and did the same with java8.

      This is the result:

      >java -version
      java version "1.7.0_60-ea"
      Java(TM) SE Runtime Environment (build 1.7.0_60-ea-b04)
      Java HotSpot(TM) Client VM (build 24.60-b07, mixed mode, sharing)

      >java Jtest5
      operations: 17176 time 2397


      >java -version
      java version "1.8.0"
      Java(TM) SE Runtime Environment (build 1.8.0-b128)
      Java HotSpot(TM) Client VM (build 25.0-b69, mixed mode)

      >java Jtest5
      operations: 17176 time 12498

      Both executions performs the same number of javascript engine invokations with the same contents, but the one using nashorn takes more than 5 times the time of the other.

      Oracle cannot deploy an engine that is so much slower than the previous one.

      Priority justification:
      Impact: High, performance degradation
      Likelhood: Medium, javascript engine invokations
      Workaround: Medium, unknown

      ILW = HMM => P2

        1. Jtest5.java
          596 kB
          Ting-Yun Ingrid Yao

            jlaskey Jim Laskey
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: