Re: Re: JDBC Performance

From: "Keith L(dot) Musser" <kmusser(at)idisys(dot)com>
To: "PGSQL-General" <pgsql-general(at)postgresql(dot)org>, "Gunnar R|nning" <gunnar(at)candleweb(dot)no>
Subject: Re: Re: JDBC Performance
Date: 2000-10-10 13:25:37
Message-ID: 008e01c032bd$e6218ca0$0201a8c0@quantum.idisys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Gunnar,

Sorry about getting the wrong name. Yes, I was referring to the modifications you posted. I ran a few more tests, which I think will clarify things:

Test #1 Test #2 Test #2 w/ GC
---------- --------- -----------
jdbc7.0-1.2.jar 1.89 ms 5.0 ms 3.9 ms
postgresql.jar (191450 bytes) 1.36 ms 3.1 ms 3.2 ms
postgresql.jar (204223 bytes) 1.78 ms 3.9 ms 4.1 ms

In Test #2 w/ GC, I purposefully ran System.gc() every 150 msec during the test. This reduces my dependence on how often I create and free objects. It also made the original driver faster than the new one.

The times depend significantly on what I do in my program -- if I cache results, I can see execution times slow down significantly (sometimes slower by a factor of 20!). (The numbers above are with the cache turned OFF.) That's why I'm running the GC frequently; with it, I get consistently good times.

The two versions of postgresql.jar are both less sensitive to memory allocation in my part of the program. That is, the times do no grow when I use a cache with these drivers.

I conclude the following:
-----------------------------
(1) the older postgresql.jar is faster than the newer one (the 191450 byte version is older). I don't know what's the difference; I didn't every realize I had two different versions until this morning.

(2) both are faster than jdbc7.0-1.2.jar in most circumstances

(3) use of System.gc() can significantly alter execution times, making benchmarking very difficult.

Hope this helps. I've attached the source for "Test #1". Test #2 is more
complicated, and probably not worth your effort -- it depends so heavily on how System.gc() is called.

- Keith

P.S. My system is RH Linux 6.2, PostgreSQL 6.5.3 on i686-pc-linux-gnu, JVM is JDK1.2.2_006 with green threads.

-----Original Message-----
From: Gunnar R|nning <gunnar(at)candleweb(dot)no>
To: Keith L. Musser <kmusser(at)idisys(dot)com>
Cc: PGSQL-General <pgsql-general(at)postgresql(dot)org>
Date: Monday, October 09, 2000 11:17 PM
Subject: Re: [GENERAL] Re: JDBC Performance

>"Keith L. Musser" <kmusser(at)idisys(dot)com> writes:
>
>> I did try out Peter's new JDBC driver on two very simple query-only
>> applications. It was about 15% slower on one of the apps and 10% faster
>> on the other, compared with jdbc7.0-1.2.jar. It worked correctly on
>> both tests.
>>
>> Neither is particularly representative, but the fact that one's faster
>> an one's slower is surprising. I have not had the time to dig into why
>> the discrepancy.
>>
>
>I assume you mean the driver the modifications I posted, unless Peter
>hasn't checked in anything to CVS recently that I am unaware off ? (I'm not
>online with my CVS snapshot at the moment...)
>
>I would sure like to see your applications(or the differences between
>them), so I can take a look at analyzing the discrepancies. Also platform
>information like jdk version, vendor and OS information is interesting. I
>suspect that the optimizations I did can have different effects depending
>on the cost of allocating new objects in a specific environment.
>
>Regards,
>
> Gunnar
>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message andrew 2000-10-10 13:42:29 Re: Making changes visible to other connections
Previous Message Bruce Momjian 2000-10-10 13:10:53 Re: My new job