Hi Srinivas,
Your file looks identical to current aarch64-port jdk8u master branch.
I am not sure about current armv7 status. You can ask it on the list: arch32-port-dev@openjdk.java.net.
For armv8 aarch64, I ran your test on my Cortex-A57 based system with latest openjdk8u, the time result is:
real 0m4.049s user 0m6.080s sys 0m0.624s
It looks much better than your result.
If this issue also exists in your armv8 platform, can you please try the following command line:
$ java -XX:+UnlockDiagnosticVMOptions -XX:+PrintIntrinsics -cp common-0.0.1-SNAPSHOT.jar:jars/* com.ericsson.athena.common.certificate.Main
to check whether crypto related intrinsics are implemented in your port. E.g. part of my output:
------------ @ 128 sun.security.provider.SHA2::implCompress (331 bytes) (intrinsic) @ 159 sun.security.provider.DigestBase::implCompressMultiBlock (23 bytes) (intrinsic, predicate) @ 159 sun.security.provider.DigestBase::implCompressMultiBlock (23 bytes) (intrinsic) @ 159 sun.security.provider.DigestBase::implCompressMultiBlock (23 bytes) (intrinsic, predicate) @ 159 sun.security.provider.DigestBase::implCompressMultiBlock (23 bytes) (intrinsic) @ 159 sun.security.provider.DigestBase::implCompressMultiBlock (23 bytes) (intrinsic, predicate) @ 8 sun.security.provider.SHA2::implCompress (331 bytes) (intrinsic) @ 180 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 70 java.lang.Math::min (11 bytes) (intrinsic) @ 87 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 128 sun.security.provider.SHA2::implCompress (331 bytes) (intrinsic) @ 159 sun.security.provider.DigestBase::implCompressMultiBlock (23 bytes) (intrinsic, predicate) @ 159 sun.security.provider.DigestBase::implCompressMultiBlock (23 bytes) (intrinsic, predicate) @ 159 sun.security.provider.DigestBase::implCompressMultiBlock (23 bytes) (intrinsic) @ 180 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 70 java.lang.Math::min (11 bytes) (intrinsic) @ 87 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 128 sun.security.provider.SHA::implCompress (491 bytes) (intrinsic) @ 159 sun.security.provider.DigestBase::implCompressMultiBlock (23 bytes) (intrinsic, predicate) @ 159 sun.security.provider.DigestBase::implCompressMultiBlock (23 bytes) (intrinsic) @ 180 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 70 java.lang.Math::min (11 bytes) (intrinsic) @ 87 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 128 sun.security.provider.SHA::implCompress (491 bytes) (intrinsic) @ 159 sun.security.provider.DigestBase::implCompressMultiBlock (23 bytes) (intrinsic, predicate) @ 159 sun.security.provider.DigestBase::implCompressMultiBlock (23 bytes) (intrinsic) @ 180 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 80 sun.security.provider.SHA::implCompress (491 bytes) (intrinsic) @ 0 java.lang.System::currentTimeMillis (0 bytes) (intrinsic) @ 54 java.lang.Math::min (11 bytes) (intrinsic) @ 57 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 77 java.lang.Math::min (11 bytes) (intrinsic) @ 11 java.lang.Math::min (11 bytes) (intrinsic) @ 14 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 9 java.lang.Integer::numberOfLeadingZeros (76 bytes) (intrinsic) @ 58 java.lang.Integer::numberOfLeadingZeros (76 bytes) (intrinsic) @ 54 java.lang.Math::min (11 bytes) (intrinsic) @ 57 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 305 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 3 java.lang.Integer::numberOfLeadingZeros (76 bytes) (intrinsic) @ 38 java.lang.Object::hashCode (0 bytes) (intrinsic, virtual) @ 60 java.lang.String::equals (81 bytes) (intrinsic) @ 38 java.lang.Object::hashCode (0 bytes) (intrinsic, virtual) @ 20 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 11 java.lang.Math::min (11 bytes) (intrinsic) @ 14 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 60 java.lang.String::indexOf (7 bytes) (intrinsic) @ 31 java.lang.String::equals (81 bytes) (intrinsic) @ 3 java.lang.String::equals (81 bytes) (intrinsic) @ 54 java.lang.String::equals (81 bytes) (intrinsic) @ 16 java.lang.Math::min (11 bytes) (intrinsic) @ 54 java.lang.Math::min (11 bytes) (intrinsic) @ 57 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 20 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 11 java.lang.Math::min (11 bytes) (intrinsic) @ 14 java.lang.System::arraycopy (0 bytes) (intrinsic) @ 3 java.lang.Integer::numberOfLeadingZeros (76 bytes) (intrinsic) @ 299 java.lang.System::arraycopy (0 bytes) (intrinsic)
------------------------
You can find that some sun.security.xxx are intrinsified. They will use ARMv8 crypto extension. However, armv7 does not have such hardware crypto support.
Thanks, Ningsheng
On 24 January 2017 at 18:31, Srinivasa Rao Ragolu sragolu@mvista.com wrote:
Hi Ningsheng,
I am very glad for your quick response. Thank you.
Issue exists on both armv7 and armv8. I have checked the patch on armv8 and it looks pretty old patch. attaching one file for your reference.
My issue is on armv7 platform . Could you suggest how can I go forward to have good performance?
Thanks, Srinivas.
On Tue, Jan 24, 2017 at 3:41 PM, Ningsheng Jian ningsheng.jian@linaro.org wrote:
Hi Srinivas,
Does your openjdk contain this path?
http://hg.openjdk.java.net/aarch64-port/jdk8/hotspot/rev/135fb0fc4123
Reference: http://mail.openjdk.java.net/pipermail/aarch64-port-dev/2014-July/001380.htm...
Thanks, Ningsheng
On 24 January 2017 at 17:03, Srinivasa Rao Ragolu sragolu@mvista.com wrote:
Hi All,
I have ported openjdk-8-72b05(from Yocto) for both armv7 and aarch64 architectures. I am sharing sample code via link, which I have run to see the crypto performance and found it is very slow compared to OpenJDK-7.
Code Location: https://drive.google.com/open?id=0BxeL64n1TNdJMlItSWpld1lIdjg
See the output below:
root@Spider:~/Certificates# uname -a Linux Spider 4.4.32-rt41-yocto-standard #1 SMP PREEMPT Mon Jan 9 00:24:23 PST 2017 aarch64 GNU/Linux root@Spider:~/Certificates# time java -cp common-0.0.1-SNAPSHOT.jar:jars/* com.ericsson.athena.common.certificate.Main ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Generating KeyPair (Size 2048)... PrivateKey: RSA Private CRT Key modulus:
cbd10bbf831335e4b9d0942ed4da062763caf63c3230f509ee7ce8c234bb6e6e6c1bf75c8e3a46f955227e7edcce1de0f6691320b1f5fa300f9f8819d0507243c264ca77cf3eac67450dd208b30f2e34cebc2bec1fc1aed6d2f389d5843492c19297038019c4302259763aec26e302362ade9b7a190f1606cc0355c698f32e206c4af84032539c3519b72feb1886ad5366a35e233942a38a32b25b25d418c0f4d452a491e164046b638d4b2777d743cdbb6b3a166fa413e0595414e3dd326468dad08465fdbbb1551915645ea9d1c4783903b08327fd003590f85446315f6df73ee64e26deac07e4fddd2e991869aac660dc489c68b989544788aeb91474258b public exponent: 10001 private exponent:
e210696a1a05b76e8d75d41112f5b5d8557a4bc8fe1809dce231442f6433208c49a270a8b04de365af657b2355e07dde2fc6e14dba6b37a7bc81c3811e3ff1a7f12314e49ec7728cce02ee46729511387160358cc961c27e1f02668c9fa97b12f422468cfcb1fbd19da38d92069a7406db60882d7d4346631e409f65e5453fe500a49f6a04c0d906b7b180436f09027606db50f45c7847ce6febe01a882ffe73f9d1f15c4bdaaaa7be4ab15431e6b665ebc358a8ee55785e4157ff46052533d4b486b13393aae1d8d0b4fd3c7468e222506703915f10a016ce6c614e97ddc4156ab3c42ecd4d60997924f2d5b8b2845d2f1b20a5132010f1d79dfd258cda1b1 primeP:
ef0c9c674cd9134beedef5c00097840ed1b7fd281a0f8de837b217e447892c698b8e8deba9fd596550dd22fc79561b5befd4659d281a44a15d56605c780eb22d809fffda7943e6f5f6dfb592b601502882e19478ec90c6f084afb8ba5eedf2509007869718ee82454e54757165ca57269090fcc35bc19f6d00ce1877f0c56d3b primeQ:
da44dde77039f5405f9130dce4d1eba783f1c8d03657a61fb43a8e15387d566a59006abefb5ffa2cdff9b3c661d62158da7f8d4a6b80eba4522292d9542d37350f0e48e46b0366ff65edebc781253518959d953e72c991581e24ebd76d92e238dae22ee2d5859ced88c0d03d35db5b7eccd1766d7f1cb1e0859ad62db867e3f1 primeExponentP:
aa05e9345be7459f4b6dcf92d998eab773988e79b85779d241d2ecc553d010039ddc2dbb01740de24eea8a18d2e058a342686a41a62550cd08cb07cc9d23aebd487004954a8cee37e17869f7c87614a24bbcd05255c7ff8750887f362790cc395ac7cf85a698f594ffca78a1c8096b85256bca2bd516592339605cecea1631c3 primeExponentQ:
c76cdaaf064bfe37e5d97ba2a7f2e0f43a4ae4a6d0affe99c30b291c5c73b04c14ab9bdc8942a50af14d6da3596ad32722e41dcd1c323b9af46ca06daf4a6cc1aed2e768c419e4b67f8405c44fcc161a33413ac6470cc21e97d43623abfae374fd1061b46150e613e5b9fdc99f769fbf58161db567c9690072320974d6a31d91 crtCoefficient:
bc841db992c7cdfa376cba7677e88d5b81c27455db2371224aa3029179c93d638d8c6aec2d1af782647e5320da356cb394115180296ed49841cf3adf0a2e3cff25669f172edd2c6e3ea5af0a3c55bd1349f5c74de41333a48ec0ae0fb45f747b94897ae7ab74e7156c5945a5833438113b6feda152b5a7190d584ff771637b4d
PublicKey: RSA Public Key modulus:
cbd10bbf831335e4b9d0942ed4da062763caf63c3230f509ee7ce8c234bb6e6e6c1bf75c8e3a46f955227e7edcce1de0f6691320b1f5fa300f9f8819d0507243c264ca77cf3eac67450dd208b30f2e34cebc2bec1fc1aed6d2f389d5843492c19297038019c4302259763aec26e302362ade9b7a190f1606cc0355c698f32e206c4af84032539c3519b72feb1886ad5366a35e233942a38a32b25b25d418c0f4d452a491e164046b638d4b2777d743cdbb6b3a166fa413e0595414e3dd326468dad08465fdbbb1551915645ea9d1c4783903b08327fd003590f85446315f6df73ee64e26deac07e4fddd2e991869aac660dc489c68b989544788aeb91474258b public exponent: 10001
Generating Certificate... Certificate PEM: -----BEGIN CERTIFICATE----- MIIDfzCCAmegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgjENMAsGA1UEKQwEVGVz dDELMAkGA1UEBhMCU0UxEjAQBgNVBAgMCVN0b2tjaG9sbTEOMAwGA1UEBwwFS2lz dGExETAPBg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
real 7m3.241s user 7m1.972s sys 0m0.196s
Could you please suggest any solution or patches to improve the performance?
Thanks in advance, Srinivas
Linaro-openjdk mailing list Linaro-openjdk@lists.linaro.org https://lists.linaro.org/mailman/listinfo/linaro-openjdk