Re: TypeInfoCache

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Daniel Migowski <dmigowski(at)ikoffice(dot)de>
Cc: pgsql-jdbc(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Gregory Stark <stark(at)enterprisedb(dot)com>, Kris Jurka <books(at)ejurka(dot)com>
Subject: Re: TypeInfoCache
Date: 2007-12-27 09:01:55
Message-ID: 47736A03.5020009@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Christian Schröder 2007-12-29 09:33:39 Re: Missing fields in getColumns() result
Previous Message Daniel Migowski 2007-12-27 08:40:02 Re: TypeInfoCache