Re: TypeInfoCache - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: TypeInfoCache
Date
Msg-id 47736A03.5020009@opencloud.com
Whole thread Raw
In response to Re: TypeInfoCache  (Daniel Migowski <dmigowski@ikoffice.de>)
Responses Re: TypeInfoCache  (Daniel Migowski <dmigowski@ikoffice.de>)
List 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

pgsql-jdbc by date:

Previous
From: Daniel Migowski
Date:
Subject: Re: TypeInfoCache
Next
From: Christian Schröder
Date:
Subject: Re: Missing fields in getColumns() result