-
Type:
Enhancement
-
Status: Closed
-
Priority:
P3
-
Resolution: Cannot Reproduce
-
Affects Version/s: 6
-
Fix Version/s: None
-
Component/s: security-libs
-
Labels:
-
Subcomponent:
-
CPU:generic
-
OS:generic
I develop a server application that has to handle a massive amount of parallel SSL connections. I use NIO and SSLEngine for that. Then I used the fine NetBeans profiler and found that the current MD5 implementation is the bottleneck of my application. I looked at the source of MD5.implCompress() and found 64 calls to trivial functions and some mathematical operations on constants.
It looks like the compiler/JVM does not do a good job at inlining. After manually inlining the function calls and pre-calculating the constant operations MD5 was around 60% faster than before.
The suggested fix to sun/security/provider/MD5.java
(submitted via mustang.dev.java.net) is too large to
include here. Refer to the attached file MD5Speed.txt.
It looks like the compiler/JVM does not do a good job at inlining. After manually inlining the function calls and pre-calculating the constant operations MD5 was around 60% faster than before.
The suggested fix to sun/security/provider/MD5.java
(submitted via mustang.dev.java.net) is too large to
include here. Refer to the attached file MD5Speed.txt.