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

Thread.getStackTrace is slow with clang

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4
    • None
    • 11, 13
    • hotspot
    • x86_64
    • os_x

    Description

      We have found Thread.getStackTrace to be much slower (2x) when jvm is built with clang compared to jvm built with gcc.
      tested clang versions coming with xcode 6/7/8/9/10
      tested gcc versions: 4.9, 6.5
      Issue affects jdk11+
      Attaching simple test case to reproduce the issue. test case calls Thread.GetStackTrace() 100k times

      on my machine results with gcc are 120(+-10) seconds
      clang results are varying a lot from run to run between 185 to 230 seconds

      To compare apples to apples (gcc vs clang on macos):
      To be able to build hotspot( jdk11) with gcc on macos I have made a patch: http://cr.openjdk.java.net/~vkempik/gcc_jdk11_macos/gcc.patch

      instructions to build hotspot (libjvm.dylib) on macos 10.14 with gcc:

      install xcode 10
      install gcc@6 from brew
      sudo ln -s /usr/local/bin/gcc-6 /usr/local/bin/gcc
      sudo ln -s /usr/local/bin/g++-6 /usr/local/bin/g++
      apply provided patch gcc.patch
      use these options with configure: --with-toolchain-type=gcc --with-toolchain-path=/usr/local/bin

      make hotspot

      copy buit libjvm.dylib into lib/server/ folder of same jdk version built with clang

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vkempik Vladimir Kempik
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: