Details
-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
None
-
b05
Description
By caching default constructors used in java.security.Provider::newInstanceUtil in a ClassValue, we can reduce the overhead of allocating instances in a variety of places, e.g., MessageDigest::getInstance, without compromising thread-safety or security.
See: https://cl4es.github.io/2021/01/04/Investigating-MD5-Overheads.html#reflection-overheads for context. Doing this reduces memory allocations made by repeated calls to MessageDigest.getInstance("MD5") by 120 bytes/op, and I expect similar improvements would show up in more places.
See: https://cl4es.github.io/2021/01/04/Investigating-MD5-Overheads.html#reflection-overheads for context. Doing this reduces memory allocations made by repeated calls to MessageDigest.getInstance("MD5") by 120 bytes/op, and I expect similar improvements would show up in more places.
Attachments
Issue Links
- duplicates
-
JDK-8229958 Provider.getService() scalability issue for legacy algorithm and message digest
- Resolved
- relates to
-
JDK-8269276 Additional tests for MessageDigest with different providers
- Resolved
-
JDK-8304700 Improve lock contention in javax.crypto.Mac.getInstance
- Open
-
JDK-8304699 Improve lock contention in java.security.MessageDigest.getInstance and java.security.Signature.getInstance
- Closed
(1 links to)