-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
11, 13
-
x86_64
-
os_x
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
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
- relates to
-
JDK-8243470 [macos] bring back O2 opt level for unsafe.cpp
- Resolved
-
JDK-8246751 Mac OS build settings should use -O3
- Resolved