RFR: Here are some URLClassPath patches

Paul Sandoz paul.sandoz at oracle.com
Mon Feb 26 22:01:06 UTC 2018



> On Feb 26, 2018, at 1:25 PM, Martin Buchholz <martinrb at google.com> wrote:
> 
> 
> 
> On Mon, Feb 26, 2018 at 9:28 AM, Paul Sandoz <paul.sandoz at oracle.com <mailto:paul.sandoz at oracle.com>> wrote:
> 
> 
> > On Feb 23, 2018, at 2:09 PM, Martin Buchholz <martinrb at google.com <mailto:martinrb at google.com>> wrote:
> >
> > [+Paul]
> >
> > On Fri, Feb 23, 2018 at 6:28 AM, Alan Bateman <Alan.Bateman at oracle.com <mailto:Alan.Bateman at oracle.com>> wrote:
> >>
> >> 8198484: URLClassPath should use an ArrayDeque instead of a Stack
> >> http://cr.openjdk.java.net/~martin/webrevs/jdk/URLClassPath-ArrayDeque/ <http://cr.openjdk.java.net/~martin/webrevs/jdk/URLClassPath-ArrayDeque/>
> >> https://bugs.openjdk.java.net/browse/JDK-8198484 <https://bugs.openjdk.java.net/browse/JDK-8198484>
> > Can copyToArrayDeque use addAll?
> >
> 
> 
> > On Feb 23, 2018, at 2:09 PM, Martin Buchholz <martinrb at google.com <mailto:martinrb at google.com>> wrote:
> 
> > Not directly, because addAll uses a lambda, and it's too early in the bootstrap for lambdas.
> >
> > We could delambdafy ArrayDeque, plausibly because ArrayDeque is a super-core class, perhaps reengineering ArrayDeque(Collection) and/or addAll(Collection).
> >
> 
> Some data on how many lambdas/methods refs are used by the core collection classes could help. I would be wary of going on a lambda purge right now and biasing certain collection classes towards their use at startup if we can avoid that with careful management.
> 
> I would be tempted to drop the method copyToArrayDeque and just rely on the push method (even though it uses synchronized), then add a comment to the unopenedUrls field and/or in the constructor.
> 
> 
> I prefer to keep things as I have them for now.  Calling push requires an extra copy to create the array,

Ok, fair point,
Paul.

> and even though that overhead is swamped by other inefficiencies, it's a tax on every single java program (and the tax is higher at Google, where we have trouble fitting the classpath into Linux' 128 kb per-arg command line length limit).
> 



More information about the core-libs-dev mailing list