Kind reminder about JDK-8193031
Сергей Цыпанов
sergei.tsypanov at yandex.ru
Thu Jun 13 11:39:30 UTC 2019
Hello,
the issue [1] was opened almost two years ago,
but even today Collections.addAll still looks like this:
public static <T> boolean addAll(Collection<? super T> c, T... elements) {
boolean result = false;
for (T element : elements)
result |= c.add(element);
return result;
}
The most wide-spread collections in Java-world is ArrayList for which Collections.addAll is likely to be slower then Collection.addAll(Arrays.asList).
The same is valid for ArrayDeque and especially for COWList. There's a webrev [2] for mentioned ticket. The whole story begins in [3].
Could the change [2] be done for JDK 13?
Regards,
Sergey Tsypanov
1. https://bugs.openjdk.java.net/browse/JDK-8193031
2. http://cr.openjdk.java.net/~martin/webrevs/jdk/Collections-addAll
3. http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-December/050326.html
More information about the core-libs-dev
mailing list