-
Enhancement
-
Resolution: Fixed
-
P3
-
11, 15, 16
-
b26
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8264943 | 11.0.12 | Aleksey Shipilev | P3 | Resolved | Fixed | b01 |
Current sun/security/provider/SHA2 implementation is written with lots of small method invocations on the fastpath in implCompress0. Normally it does not matter much, because compilers are able to inline through it, and then some compilers even intrinsify the entire implCompress0.
But it comes as major downside for platforms that do not have SHA2 intrinsics, or that VM configs (like Zero) that blindly interpret the bytecode. Zero, for example, keeps re-entering the small methods when computing SHA2 digests during jmod/jlink generation during the build, and spends significant time there.
Motivational example:
- original Linux x86_64 Zero fastdebug build: 18.5 min
- modified Linux x86_64 Zero fastdebug build: 11.0 min
Note that SHA1 is already written in similar streamlined style. SHA5 is written with helper functions. This patch moves SHA2 to be closer to SHA1 style-wise.
But it comes as major downside for platforms that do not have SHA2 intrinsics, or that VM configs (like Zero) that blindly interpret the bytecode. Zero, for example, keeps re-entering the small methods when computing SHA2 digests during jmod/jlink generation during the build, and spends significant time there.
Motivational example:
- original Linux x86_64 Zero fastdebug build: 18.5 min
- modified Linux x86_64 Zero fastdebug build: 11.0 min
Note that SHA1 is already written in similar streamlined style. SHA5 is written with helper functions. This patch moves SHA2 to be closer to SHA1 style-wise.
- backported by
-
JDK-8264943 Streamline Java SHA2 implementation
- Resolved