RFR  optimization of CopyOnWriteArrayList.addIfAbsent()
martinrb at google.com
Tue Apr 2 20:55:21 UTC 2013
Thanks for this change. There is a tradeoff here. If the element is never
present, then the older code might be a little faster, because we can avoid
re-traversing the array. Otherwise, the new code is better.
I prefer it your way (I hate unneeded allocation), but the code was
intentionally written the other way. Let's hear from Doug...
On Tue, Apr 2, 2013 at 1:38 PM, Ivan Gerasimov <ivan.gerasimov at oracle.com>wrote:
> Please review my proposal for the CopyOnWriteArrayList.addIfAbsent()
>> method optimization.
> This URL is not readable by external reviewers.
> The webrev has been copied here:
> The "master" version of CopyOnWriteArrayList is here:
> Thanks for the link!
> I see that the code in the master version is identical to the one I've
> been working on.
> So the optimization still could be applied.
More information about the core-libs-dev