Return-Path: X-Original-To: apmail-geronimo-dev-archive@www.apache.org Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 50D3610840 for ; Thu, 25 Apr 2013 13:26:02 +0000 (UTC) Received: (qmail 83710 invoked by uid 500); 25 Apr 2013 13:26:01 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 83576 invoked by uid 500); 25 Apr 2013 13:26:01 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 83549 invoked by uid 99); 25 Apr 2013 13:26:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Apr 2013 13:26:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of rmannibucau@gmail.com designates 209.85.212.47 as permitted sender) Received: from [209.85.212.47] (HELO mail-vb0-f47.google.com) (209.85.212.47) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Apr 2013 13:25:57 +0000 Received: by mail-vb0-f47.google.com with SMTP id x13so2602910vbb.6 for ; Thu, 25 Apr 2013 06:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=csZXq/YtwfirEGcR8ONg2pAmu7f2Y0yBUaIEZshaQbM=; b=yH0W1JIEbi6dilgWZaXJsbv6GANKmxQ49Kj1Bn52cSfZqcq0pqxQYVdi9u+d9/Ahz0 ESvL15qc3fQjLR8s9tMSbmHHsqJTrMKxdIKjro4bNgvo6INPNa6j6+VPf2J5+03oX5N3 XJvJjBQqInk9xwTkYStGhZA02jEUOX6goNI1XcMGiwSSqmB6oT9BoawPjCYHvdFz1Y5A kWDYEFRCS+zV23l6cuWKdEjua7It7gK0gXZ+Zgb88PaCx7KSzOtUcuXXmY8DZ9McpPI/ HPCgR8CHPXnr2tflpsYmS/X/yRvThU/xpPe6VB9uqxxoDtDtRw0G6NmCOBh9D75ErMlC R3Qg== X-Received: by 10.52.103.50 with SMTP id ft18mr15063452vdb.108.1366896336596; Thu, 25 Apr 2013 06:25:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.249.194 with HTTP; Thu, 25 Apr 2013 06:25:16 -0700 (PDT) In-Reply-To: <1742F663-F85B-4475-A7F8-8D5CAC99818A@gmail.com> References: <1742F663-F85B-4475-A7F8-8D5CAC99818A@gmail.com> From: Romain Manni-Bucau Date: Thu, 25 Apr 2013 15:25:16 +0200 Message-ID: Subject: Re: xbean finder getURLs() To: dev@geronimo.apache.org Content-Type: multipart/alternative; boundary=047d7bacb7e496a57704db2f5a5f X-Virus-Checked: Checked by ClamAV on apache.org --047d7bacb7e496a57704db2f5a5f Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable tested a bit perfs using AppClassLoader only (so it can be a bit different in a JavaEE or OSGi envrt) single call: URLClassLoader =3D> 654 vs getResources =3D> 1130 (ms but the = unit is not important) 1000 calls: 5503 vs 612621 i'll check our tests are still passing then commit the change if nobody shouts before *Romain Manni-Bucau* *Twitter: @rmannibucau * *Blog: **http://rmannibucau.wordpress.com/* *LinkedIn: **http://fr.linkedin.com/in/rmannibucau* *Github: https://github.com/rmannibucau* 2013/4/25 Kevan Miller > > On Apr 17, 2013, at 3:22 AM, Romain Manni-Bucau > wrote: > > > Hi, > > > > in org.apache.xbean.finder.UrlSet#getUrls we rely on META-INF (or "") t= o > find jars. There are cases where it doesn't work at all (a common case > where i saw it is when you only have META-INF/MANIFEST.MF which is consid= er > for a single entry and not META-INF then MANIFEST.MF - depends the build > tool/zip format if i understood correctly) > > > > the question are: > > 1) do we getresources("META-INF/MANIFEST.MF") too > > 2) why not simply querying the classloader which is very very often an > URLClassLoader -> if (yes) return Arrays.asList(classLoader.getURLs()); > else currentImpl; > > > > The 2 seems less correct but in practise i think it is more efficient - > we can do both too (testing URLClassLoader and if not adding MANIFEST.MF > listing) > > > > wdyt? > > Hi Romain, > I'd be interested in some examples. What tools/jars don't contain a > META-INF? But contain META-INF/MANIFEST.MF? > > Anyway, given that they (tools/jars) evidently exist, I guess 2) is ok. A= s > you say, it may be faster. Concern will be about changing the behavior. B= ut > if we get sufficient testing, should be ok=85 > > --kevan --047d7bacb7e496a57704db2f5a5f Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable tested a bit perfs using AppClassLoader only (so it can be a bit different = in a JavaEE or OSGi envrt)

single call: URLClassLoader = =3D> 654 vs getResources =3D> 1130 (ms but the unit is not important)=
1000 calls:=A05503 vs 612621

i'll check o= ur tests are still passing then commit the change if nobody shouts before





2013/4/25 Kevan Miller <kevan.mill= er@gmail.com>

On Apr 17, 2013, at 3:22 AM, Romain Manni-Bucau <rmannibucau@gmail.com> wrote:

> Hi,
>
> in org.apache.xbean.finder.UrlSet#getUrls we rely on META-INF (or &quo= t;") to find jars. There are cases where it doesn't work at all (a= common case where i saw it is when you only have META-INF/MANIFEST.MF whic= h is consider for a single entry and not META-INF then MANIFEST.MF - depend= s the build tool/zip format if i understood correctly)
>
> the question are:
> 1) do we getresources("META-INF/MANIFEST.MF") too
> 2) why not simply querying the classloader which is very very often an= URLClassLoader -> if (yes) return Arrays.asList(classLoader.getURLs());= else currentImpl;
>
> The 2 seems less correct but in practise i think it is more efficient = - we can do both too (testing URLClassLoader and if not adding MANIFEST.MF = listing)
>
> wdyt?

Hi Romain,
I'd be interested in some examples. What tools/jars don't contain a= META-INF? But contain META-INF/MANIFEST.MF?

Anyway, given that they (tools/jars) evidently exist, I guess 2) is ok. As = you say, it may be faster. Concern will be about changing the behavior. But= if we get sufficient testing, should be ok=85

--kevan

--047d7bacb7e496a57704db2f5a5f--