-
Bug
-
Resolution: Unresolved
-
P3
-
24, 25
I am seeing a significant performance drop for Math.tanh API with latest jdk-25 build vs jdk-23.0.2
/home/jatinbha/softwares/jdk-23.0.2//bin/java
CPROMPT>java -Xbatch -XX:-TieredCompilation -cp /home/intel/.m2/repository/net/jafama/jafama/2.3.2/jafama-2.3.2.jar:. perf_tanh 10000 1
[time] 151 ms [res] 4730986895511650304
CPROMPT>
CPROMPT>
CPROMPT>export JAVA_HOME=/home/jatinbha/softwares/jdk-25/
CPROMPT>export PATH=$JAVA_HOME/bin:$PATH
CPROMPT>
CPROMPT>java -Xbatch -XX:-TieredCompilation -cp /home/intel/.m2/repository/net/jafama/jafama/2.3.2/jafama-2.3.2.jar:. perf_tanh 10000 1
[time] 755 ms [res] 4730986895511650304
While the attached test compares the performance of FastMath.tanh routine from JaFaMa library (https://github.com/jeffhain/jafama) vs JDK Math.tanh implementation, the concern here is mainly around Math.tanh performance with JDK-25.
tanh is used as a common activation function in DNNs, one of its references is seen in Jlama - Java-based inferencing engine.
https://github.com/tjake/Jlama/blob/main/jlama-core/src/main/java/com/github/tjake/jlama/math/ActivationFunction.java#L35C34-L35C42
/home/jatinbha/softwares/jdk-23.0.2//bin/java
CPROMPT>java -Xbatch -XX:-TieredCompilation -cp /home/intel/.m2/repository/net/jafama/jafama/2.3.2/jafama-2.3.2.jar:. perf_tanh 10000 1
[time] 151 ms [res] 4730986895511650304
CPROMPT>
CPROMPT>
CPROMPT>export JAVA_HOME=/home/jatinbha/softwares/jdk-25/
CPROMPT>export PATH=$JAVA_HOME/bin:$PATH
CPROMPT>
CPROMPT>java -Xbatch -XX:-TieredCompilation -cp /home/intel/.m2/repository/net/jafama/jafama/2.3.2/jafama-2.3.2.jar:. perf_tanh 10000 1
[time] 755 ms [res] 4730986895511650304
While the attached test compares the performance of FastMath.tanh routine from JaFaMa library (https://github.com/jeffhain/jafama) vs JDK Math.tanh implementation, the concern here is mainly around Math.tanh performance with JDK-25.
tanh is used as a common activation function in DNNs, one of its references is seen in Jlama - Java-based inferencing engine.
https://github.com/tjake/Jlama/blob/main/jlama-core/src/main/java/com/github/tjake/jlama/math/ActivationFunction.java#L35C34-L35C42
- caused by
-
JDK-8338694 x86_64 intrinsic for tanh using libm
-
- Resolved
-