Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Not an Issue
    • Affects Version/s: 9
    • Fix Version/s: None
    • Component/s: performance
    • Labels:

      Description

      Startup of Jython with JDK 9 (and server VM) appears to have regressed since JDK 8. Consider the following bench.py and execution with JDK 8 and JDK 9 (jdk-9+136)

      import java.lang
      c = java.lang.Class.forName("java.lang.Boolean")
      print c
      (exit)

      $ time -p java -jar jython-standalone-2.7.0.jar bench.py
      <type 'java.lang.Boolean'>
      real 2.26
      user 6.38
      sys 0.26

      $ time -p java --add-exports=java.base/sun.nio.ch=ALL-UNNAMED -jar jython-standalone-2.7.0.jar bench.py
      <type 'java.lang.Boolean'>
      real 2.36
      user 7.53
      sys 0.29

      User time on this system has increased. Part of the issue seems to be the switch to G1. Another part may be increased usages of lambdas in the regex code.

        Issue Links

          Activity

          Hide
          alanb Alan Bateman added a comment - - edited
          Claes Redestad has tracked down the main issue. It seems that Jython creates a cache on first usage where it stores an index of the packages in each JAR file in the JDK image. It seems to bring that cache by scanning rt.jar. This means startup with JDK 8 is initially slow but is significant faster on subsequent usages. With JDK 9 then rt.jar no longer exists so Jython doesn't have a cache. If Jython is updated to use jrtfs and integrates this with this cache then the startup regression should disappear.
          Show
          alanb Alan Bateman added a comment - - edited Claes Redestad has tracked down the main issue. It seems that Jython creates a cache on first usage where it stores an index of the packages in each JAR file in the JDK image. It seems to bring that cache by scanning rt.jar. This means startup with JDK 8 is initially slow but is significant faster on subsequent usages. With JDK 9 then rt.jar no longer exists so Jython doesn't have a cache. If Jython is updated to use jrtfs and integrates this with this cache then the startup regression should disappear.
          Hide
          sfelts Stephen Felts added a comment -
          The problem is in Jython that it is not caching the jimage packages.
          Show
          sfelts Stephen Felts added a comment - The problem is in Jython that it is not caching the jimage packages.

            People

            • Assignee:
              redestad Claes Redestad
              Reporter:
              alanb Alan Bateman
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: