Integrated: 8253179: Replace LinkedList Impl in net.http.Http2Connection

Conor Cleary ccleary at openjdk.java.net
Wed Oct 7 06:24:11 UTC 2020


On Wed, 30 Sep 2020 10:22:11 GMT, Conor Cleary <ccleary at openjdk.org> wrote:

> This patch replaces a LinkedList data structure used in the net.http.Http2Connection class with an ArrayList. This
> issue relates to [JDK-8246048: Replace LinkedList with ArrayLists in
> java.net](https://bugs.openjdk.java.net/browse/JDK-8246048).  Some justifications for this change are as follows:
> 
> - Sequential Access Times for ArrayLists are improved due to locality of reference (i.e ArrayList elements stored in same
>   memory neighborhood)
> - Get(index) operations are O(1) time complexity for ArrayLists as opposed to worst-case O(N-1) for LinkedLists
> - While insertion operations can be expensive (O(N) in the worst case), these operations appear to be
>   infrequent/non-existent in this case.
> 
> Additional justifications or challenges to those listed are welcome! The general idea is that ArrayLists out-perform
> LinkedLists in this scenario.

This pull request has now been integrated.

Changeset: 703b345e
Author:    Conor Cleary <ccleary at openjdk.org>
Committer: Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/703b345e
Stats:     5 lines in 1 file changed: 1 ins; 2 del; 2 mod

8253179: Replace LinkedList Impl in net.http.Http2Connection

Reviewed-by: dfuchs, prappo, chegar, shade

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

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


More information about the net-dev mailing list