From dev-return-23310-apmail-jackrabbit-dev-archive=jackrabbit.apache.org@jackrabbit.apache.org Wed May 06 11:26:23 2009 Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 57513 invoked from network); 6 May 2009 11:26:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 May 2009 11:26:23 -0000 Received: (qmail 2576 invoked by uid 500); 6 May 2009 11:26:23 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 2477 invoked by uid 500); 6 May 2009 11:26:22 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 2469 invoked by uid 99); 6 May 2009 11:26:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 11:26:22 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fmeschbe@gmail.com designates 209.85.134.191 as permitted sender) Received: from [209.85.134.191] (HELO mu-out-0910.google.com) (209.85.134.191) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 May 2009 11:26:13 +0000 Received: by mu-out-0910.google.com with SMTP id i2so12889mue.1 for ; Wed, 06 May 2009 04:25:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=E6ZMHDtSsXg2Sx/2nPmjORExVQTzRwzFM3UZzpHypYw=; b=lktG54Vub8UEo7JGSKX2VYTi13EY2zNg0KU9aYjswnxpnBBkMdBeZUw2WIa4BOlnEw wsQLPYTCne7SBGfTviXM31PHWg216pTYzcaDLrsOC4AYYVCaiL1jNl2t1BuxmBBPTgAv Yf92cAHoysl3aUrhv7rV9S0m8MBwxkpMC5iC8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=kresxzN8Fs/MMRz1U8Vs35e83oh/e7B44urDFZCSNZdlr4I+dx39OsfZMYceF1jbi7 d9gY9XMg8fw4KHoNnxi3ZgmEVrHe7Qglskc4/tODxOactJEsJeCp81zwt9EF9IE1NbmR TnX7BpAQEeSoWpRCJxBouLO7iuIxU9vYQQ+U0= Received: by 10.103.250.1 with SMTP id c1mr802807mus.64.1241609151512; Wed, 06 May 2009 04:25:51 -0700 (PDT) Received: from bslm-046.corp.day.com (cable-static-138-82.eblcom.ch [87.102.138.82]) by mx.google.com with ESMTPS id 12sm22528552muq.53.2009.05.06.04.25.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 06 May 2009 04:25:51 -0700 (PDT) Message-ID: <4A0173BE.2090100@gmail.com> Date: Wed, 06 May 2009 13:25:50 +0200 From: Felix Meschberger User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: dev@jackrabbit.apache.org Subject: Re: Generics generator class References: <91f3b2650905040617w57e838c8y106809810c6aaa82@mail.gmail.com> <91f3b2650905050456q7c8107c4p7cbba084ea19461@mail.gmail.com> <91f3b2650905060121u7e08f277t3571700ed1c75ef7@mail.gmail.com> <4A014BB5.1010303@gmx.de> <91f3b2650905060136p7460074alc5b8f074d6931599@mail.gmail.com> <4A015147.5020907@gmail.com> <91f3b2650905060215s27c1002dld50fbe3ab440b9b6@mail.gmail.com> <4A015B5B.3080002@gmx.de> <91f3b2650905060335s629b992aqe6d00168178b1fdc@mail.gmail.com> In-Reply-To: <91f3b2650905060335s629b992aqe6d00168178b1fdc@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi, Thomas M=FCller schrieb: > Hi, >=20 >> I do care about performance, so yes, I'd like so see numbers. >=20 > My test case is: >=20 > public static void main(String[] args) { > for (int i =3D 0; i < 3; i++) { > long start =3D System.currentTimeMillis(); > ArrayList list =3D new ArrayList(); > for (int j =3D 0; j < 1000000000; j++) { > list.size(); > } > System.out.println(System.currentTimeMillis() - start); > } > } >=20 > With JDK 1.5 (Mac OS X): ArrayList declaration: 3028 List declaration: = 8037 I stand corrected, but is this worth it ?? >=20 > But I agree it's almost never really an issue. Most performance > problems are not related to this. Oh yeah ! Regards Felix >=20 >> Bloch advises to use interfaces in Effective Java, 2nd edition, Item 5= 2. >=20 > In Effective Java, first edition, it's issue 34, page 156: "Refer to > objects by their interfaces - If appropriate interfaces exist, > parameters, returns values, variables, and fields should all be > declared using interface types". ... "could be changed ... and all of > the surrounding code would continue to work" >=20 > I do agree to this, except for variables and private fields that don't > affect the surrounding code. >=20 > Regards, > Thomas >=20