Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 09BD32E02E4 for ; Thu, 27 Dec 2007 05:02:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 04614-05 for ; Thu, 27 Dec 2007 05:01:59 -0400 (AST) Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 745C12E0291 for ; Thu, 27 Dec 2007 05:02:06 -0400 (AST) Received: from 219-89-38-193.dialup.xtra.co.nz ([219.89.38.193] helo=[192.168.1.2]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1J7ock-0000UP-P2; Thu, 27 Dec 2007 22:01:55 +1300 Message-ID: <47736A03.5020009@opencloud.com> Date: Thu, 27 Dec 2007 22:01:55 +1300 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Daniel Migowski CC: pgsql-jdbc@postgresql.org, Tom Lane , Gregory Stark , Kris Jurka Subject: Re: TypeInfoCache References: <47692DEB.9070307@ikoffice.de> <877ijan2cp.fsf@oxford.xeocode.com> <47693B10.3040804@ikoffice.de> <873atymzpu.fsf@oxford.xeocode.com> <4769604A.9050006@ikoffice.de> <476989C7.8020307@opencloud.com> <1811.1198113944@sss.pgh.pa.us> <476A4AB7.90509@ikoffice.de> <11679.1198165116@sss.pgh.pa.us> <476A9083.80407@ikoffice.de> <477364E2.2010808@ikoffice.de> In-Reply-To: <477364E2.2010808@ikoffice.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/179 X-Sequence-Number: 18034 Daniel Migowski wrote: > getString on text_col took 8.27384ms > getCharacterStream on text_col took 14.26489ms > Factor: 1.724095462324628 > getString on varchar_col took 9.57153ms > getCharacterStream on varchar_col took 12.76733ms > Factor: 1.3338860140437319 > Conclusion: There is no real performance loss even in the worst case > (which should never occur anyway), so please accept my patch. I wish you > all a happy new year! I'm confused. Don't your numbers show a 30%-70% slowdown when using getCharacterStream()? Also some quick notes about microbenchmarks: - 1000 iterations isn't really enough to get useful numbers, try 20,000+ for JIT effects or considerably more for GC effects - server vs. client JVM can have quite different behaviours, you should check both - put your inner benchmark loops in a separate method as some JIT has method-level granularity - benchmark the same code path in your warmup loop as you actually measure the numbers from. In your code, you're benchmarking a different code path to the one you run in your warmup loop. -O