-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
None
-
None
The AES microbenchmark in openjdk/bench/javax/crypto/AES.java tests the performance on Cipher.doFinal(byte[]). This method allocates an array and returns it. AES is very fast due to the use of specialized instructions, and so the time required to allocate (and later collect) these arrays ends up being a significant fraction of the total execution time for this benchmark. As a result, this test gives somewhat misleading results.
It would be better to allocate an array during setup and reuse it by calling Cipher.doFinal(byte[], int, int, byte[]). Also see if this pattern is repeated for other Cipher benchmarks.
It would be better to allocate an array during setup and reuse it by calling Cipher.doFinal(byte[], int, int, byte[]). Also see if this pattern is repeated for other Cipher benchmarks.
- duplicates
-
JDK-8215643 Microbenchmarks for KeyAgreement and Cipher
- Resolved