X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 2BBEC8B9E4A for ; Tue, 22 Feb 2005 21:50:17 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 25849-02 for ; Tue, 22 Feb 2005 21:50:14 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 749978B9E16 for ; Tue, 22 Feb 2005 21:50:14 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1D3huz-0004WP-00; Wed, 23 Feb 2005 10:50:09 +1300 Message-ID: <421BA910.9050706@opencloud.com> Date: Wed, 23 Feb 2005 10:50:08 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0 (X11/20041228) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ken Geis Cc: pgsql-jdbc@postgresql.org Subject: Re: Performance tweaks References: <421B0740.3050104@speakeasy.net> <421BA48A.4010601@opencloud.com> In-Reply-To: <421BA48A.4010601@opencloud.com> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/162 X-Sequence-Number: 12342 Oliver Jowett wrote: > Ken Geis wrote: > >> I changed the line >> >> byte[][] answer = new byte[l_nf][0]; >> to >> byte[][] answer = new byte[l_nf][]; >> >> This gave ~1% increase on the benchmark I was running. > > > Gah?! What JVM? Aren't the two forms equivalent? Hmm, after some experimentation, they do produce different bytecode (multianewarray vs. anewarray): public void testit() { byte[][] dummy = new byte[10][0]; byte[][] dummy2 = new byte[10][]; } public void testit(); Code: 0: bipush 10 2: iconst_0 3: multianewarray #2, 2; //class "[[B" 7: astore_1 8: bipush 10 10: anewarray #3; //class "[B" 13: astore_2 14: return Interesting to know it makes a performance difference. What JVM did you test on? -O