<div dir="ltr">Thanks! I'm working on the OCA right now, I made a mistake when I submitted it before so I'll follow up when it's done.<div><br></div><div>Anything else I need to do? Could this also be backported to version 8?</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 25, 2017 at 7:05 AM, Sean Mullan <span dir="ltr"><<a href="mailto:sean.mullan@oracle.com" target="_blank">sean.mullan@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Steven,<br>
<br>
Thanks, I filed an issue on your behalf for tracking purposes: <a href="https://bugs.openjdk.java.net/browse/JDK-8179275" rel="noreferrer" target="_blank">https://bugs.openjdk.java.net/<wbr>browse/JDK-8179275</a><br>
<br>
Also, have you signed the OCA? See <a href="http://www.oracle.com/technetwork/community/oca-486395.html" rel="noreferrer" target="_blank">http://www.oracle.com/technetw<wbr>ork/community/oca-486395.html</a> for more information.<span class="HOEnZb"><font color="#888888"><br>
<br>
--Sean</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On 4/15/17 3:25 PM, Steven Davidovitz wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
With the removal of the synchronization on priorityMap inside<br>
'SignatureAndHashAlgorithm.get<wbr>SupportedAlgorithms' in rev daaace32c979<br>
[1], it seems unnecessary to use a synchronizedSortedMap.<br>
Benchmarking, I see a 2x performance increase by using the bare<br>
TreeMap.<br>
<br>
measureModified sample 11336330 11949.506 ± 1775.776 ns/op<br>
measureOriginal sample 10855026 23003.654 ± 2286.571 ns/op<br>
<br>
Thanks,<br>
Steven Davidovitz<br>
<br>
1: <a href="http://hg.openjdk.java.net/jdk9/dev/jdk/rev/daaace32c979" rel="noreferrer" target="_blank">http://hg.openjdk.java.net/jdk<wbr>9/dev/jdk/rev/daaace32c979</a><br>
<br>
diff --git a/src/java.base/share/classes/<wbr>sun/security/ssl/SignatureAndH<wbr>ashAlgorithm.java<br>
b/src/java.base/share/classes/<wbr>sun/security/ssl/SignatureAndH<wbr>ashAlgorithm.java<br>
--- a/src/java.base/share/classes/<wbr>sun/security/ssl/SignatureAndH<wbr>ashAlgorithm.java<br>
+++ b/src/java.base/share/classes/<wbr>sun/security/ssl/SignatureAndH<wbr>ashAlgorithm.java<br>
@@ -396,46 +396,42 @@<br>
}<br>
<br>
static {<br>
- supportedMap = Collections.synchronizedSorted<wbr>Map(<br>
- new TreeMap<Integer, SignatureAndHashAlgorithm>());<br>
- priorityMap = Collections.synchronizedSorted<wbr>Map(<br>
- new TreeMap<Integer, SignatureAndHashAlgorithm>());<br>
-<br>
- synchronized (supportedMap) {<br>
- int p = SUPPORTED_ALG_PRIORITY_MAX_NUM<wbr>;<br>
- supports(HashAlgorithm.MD5, SignatureAlgorithm.RSA,<br>
- "MD5withRSA", --p);<br>
- supports(HashAlgorithm.SHA1, SignatureAlgorithm.DSA,<br>
- "SHA1withDSA", --p);<br>
- supports(HashAlgorithm.SHA1, SignatureAlgorithm.RSA,<br>
- "SHA1withRSA", --p);<br>
- supports(HashAlgorithm.SHA1, SignatureAlgorithm.ECDSA,<br>
- "SHA1withECDSA", --p);<br>
+ supportedMap = new TreeMap<Integer, SignatureAndHashAlgorithm>();<br>
+ priorityMap = new TreeMap<Integer, SignatureAndHashAlgorithm>();<br>
<br>
- if (Security.getProvider("SunMSCA<wbr>PI") == null) {<br>
- supports(HashAlgorithm.SHA224,<wbr> SignatureAlgorithm.DSA,<br>
- "SHA224withDSA", --p);<br>
- supports(HashAlgorithm.SHA224,<wbr> SignatureAlgorithm.RSA,<br>
- "SHA224withRSA", --p);<br>
- supports(HashAlgorithm.SHA224,<wbr> SignatureAlgorithm.ECDSA,<br>
- "SHA224withECDSA", --p);<br>
- }<br>
+ int p = SUPPORTED_ALG_PRIORITY_MAX_NUM<wbr>;<br>
+ supports(HashAlgorithm.MD5, SignatureAlgorithm.RSA,<br>
+ "MD5withRSA", --p);<br>
+ supports(HashAlgorithm.SHA1, SignatureAlgorithm.DSA,<br>
+ "SHA1withDSA", --p);<br>
+ supports(HashAlgorithm.SHA1, SignatureAlgorithm.RSA,<br>
+ "SHA1withRSA", --p);<br>
+ supports(HashAlgorithm.SHA1, SignatureAlgorithm.ECDSA,<br>
+ "SHA1withECDSA", --p);<br>
<br>
- supports(HashAlgorithm.SHA256,<wbr> SignatureAlgorithm.DSA,<br>
- "SHA256withDSA", --p);<br>
- supports(HashAlgorithm.SHA256,<wbr> SignatureAlgorithm.RSA,<br>
- "SHA256withRSA", --p);<br>
- supports(HashAlgorithm.SHA256,<wbr> SignatureAlgorithm.ECDSA,<br>
- "SHA256withECDSA", --p);<br>
- supports(HashAlgorithm.SHA384,<wbr> SignatureAlgorithm.RSA,<br>
- "SHA384withRSA", --p);<br>
- supports(HashAlgorithm.SHA384,<wbr> SignatureAlgorithm.ECDSA,<br>
- "SHA384withECDSA", --p);<br>
- supports(HashAlgorithm.SHA512,<wbr> SignatureAlgorithm.RSA,<br>
- "SHA512withRSA", --p);<br>
- supports(HashAlgorithm.SHA512,<wbr> SignatureAlgorithm.ECDSA,<br>
- "SHA512withECDSA", --p);<br>
+ if (Security.getProvider("SunMSCA<wbr>PI") == null) {<br>
+ supports(HashAlgorithm.SHA224,<wbr> SignatureAlgorithm.DSA,<br>
+ "SHA224withDSA", --p);<br>
+ supports(HashAlgorithm.SHA224,<wbr> SignatureAlgorithm.RSA,<br>
+ "SHA224withRSA", --p);<br>
+ supports(HashAlgorithm.SHA224,<wbr> SignatureAlgorithm.ECDSA,<br>
+ "SHA224withECDSA", --p);<br>
}<br>
+<br>
+ supports(HashAlgorithm.SHA256,<wbr> SignatureAlgorithm.DSA,<br>
+ "SHA256withDSA", --p);<br>
+ supports(HashAlgorithm.SHA256,<wbr> SignatureAlgorithm.RSA,<br>
+ "SHA256withRSA", --p);<br>
+ supports(HashAlgorithm.SHA256,<wbr> SignatureAlgorithm.ECDSA,<br>
+ "SHA256withECDSA", --p);<br>
+ supports(HashAlgorithm.SHA384,<wbr> SignatureAlgorithm.RSA,<br>
+ "SHA384withRSA", --p);<br>
+ supports(HashAlgorithm.SHA384,<wbr> SignatureAlgorithm.ECDSA,<br>
+ "SHA384withECDSA", --p);<br>
+ supports(HashAlgorithm.SHA512,<wbr> SignatureAlgorithm.RSA,<br>
+ "SHA512withRSA", --p);<br>
+ supports(HashAlgorithm.SHA512,<wbr> SignatureAlgorithm.ECDSA,<br>
+ "SHA512withECDSA", --p);<br>
}<br>
}<br>
<br>
</blockquote>
</div></div></blockquote></div><br></div>