On 2018-01-26 07:20, Martin Buchholz wrote:
It's still possible to find simple performance improvements in classes like ArrayList.
Indeed! It seems ArrayList.SubList delegates quite a few of its implementations to AbstractList and AbstractCollection, which uses iterators for things that could be done more efficiently with conventional for-loops. This includes contains, equals, hashCode, indexOf, lastIndexOf... I saw up to 7x improvements on some of these over the inherited implementations when providing specialized ones for ImmutableList.SubList as part of JDK-8193128 I'll file a bug and maybe even tinker with it when I find some time... /Claes