On Sun, 6 Feb 2022 22:11:06 GMT, Claes Redestad <redes...@openjdk.org> wrote:

> This looks like an appropriate solution which avoids the minor compatibility 
> risk introduced by the previous change - and you might even end up being more 
> efficient both when setting and reading the names/matchers.
> 
> (Since we're going down the route of optimizing this: the `type` of a 
> `SNIServerName` is constrained to a value between 0 and 255, so there's 
> likely a small micro-optimization opportunity in using a `BitSet` for the 
> duplicate checking rather a `ArrayList<Integer>`.. A `BitSet(256)` should 
> have lower memory use and the existence check will run in O(1) instead of 
> O(n) time. Might not be worthwhile to optimize these setters, though..)

Thank you for the quick review.  As the number of SNIServerName is normally one 
in practice, I'm not very sure of the improvement to use BitSet yet.  But I'm 
glad to know the BitSet could be a better choice if the items number goes 
beyond 4.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7359

Reply via email to