Re: Performance problem iterating a resultset

From: Teofilis Martisius <teo(at)teohome(dot)lzua(dot)lt>
To: Riyaz(at)umapinc(dot)com
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Performance problem iterating a resultset
Date: 2002-10-18 19:18:40
Message-ID: 20021018191840.GA3650@teohome.lzua.lt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

Hi,

While testing PostgreSQL JDBC I have noticed that it uses byte[]->String
conversion everywhere via 'new String(byte[], encoding)' constructor. I
found the implementation of that constructor painfully slow at least in
Sun's JDK 1.3.1 and 1.4.0, a bit better in gcj 3.2. I have made a patch
that uses my own UTF-8 Unicode byte[]->String constructor and it speeds
up iterating a resultset ~1.5-2x on Sun's JDK.

Please confirm if anyone has similar experience. I will post the patch
to this mailing list if you are interested in it. Too bad it only works
with Unicode databases, and uses the default String constructor for other
character codings.

Teofilis Martisius,
teo(at)teohome(dot)lzua(dot)lt

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrei Ivanov 2002-10-18 19:29:13 creating a new type in C
Previous Message Robert Treat 2002-10-18 19:10:14 Re: How to get the primary key fields?

Browse pgsql-jdbc by date

  From Date Subject
Next Message Nic Ferrier 2002-10-18 19:27:20 Re: Getting a ResultSet for a refcursor element.
Previous Message Nic Ferrier 2002-10-18 18:33:24 Re: problem with the build file?