pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Daniel Migowski <dmigowski@ikoffice.de>
Cc: pgsql-jdbc@postgresql.org
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Gregory Stark <stark@enterprisedb.com>
Cc: Kris Jurka <books@ejurka.com>
Subject: Re: TypeInfoCache
Date: Thu, 27 Dec 2007 22:01:55 +1300
Message-ID: <47736A03.5020009@opencloud.com> (raw)
In-Reply-To: <477364E2.2010808@ikoffice.de>
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>

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



view thread (32+ messages)

Message-ID: <47736A03.5020009@opencloud.com>
Permalink:  ../47736A03.5020009@opencloud.com/
Also on:    postgresql.org/message-id/47736A03.5020009@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, dmigowski@ikoffice.de, tgl@sss.pgh.pa.us, stark@enterprisedb.com, books@ejurka.com
  Subject: Re: TypeInfoCache
  In-Reply-To: <47736A03.5020009@opencloud.com>
  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> <47736A03.5020009@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox