X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 02F8A9DC836 for ; Wed, 8 Mar 2006 11:11:27 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 21398-04 for ; Wed, 8 Mar 2006 11:11:31 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by postgresql.org (Postfix) with ESMTP id DDAB39DC81C for ; Wed, 8 Mar 2006 11:11:23 -0400 (AST) Received: from 221x253x225x162.ap221.ftth.ucom.ne.jp ([221.253.225.162] helo=[192.168.1.171]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1FH0Jx-0001QC-A4; Thu, 09 Mar 2006 04:11:25 +1300 Message-ID: <440EF41E.20508@opencloud.com> Date: Thu, 09 Mar 2006 00:11:26 +0900 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Thomas Dudziak CC: Michael Paesold , pgsql-jdbc@postgresql.org Subject: Re: Performance problem with timestamps in result sets References: <224f32340603080537ld424d49l2eea9440594104d3@mail.gmail.com> <060a01c642bf$b3060220$9001a8c0@zaphod> <224f32340603080657m35f7c35do34a2c6dc3f1b5f0@mail.gmail.com> In-Reply-To: <224f32340603080657m35f7c35do34a2c6dc3f1b5f0@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200603/38 X-Sequence-Number: 14819 Thomas Dudziak wrote: > On 3/8/06, Michael Paesold wrote: > > >>This should be 1 ms per getTimestamp call, shouldn't it? The time is the >>aggregate time for ~8000 calls. That is still rather slow, yeah, but it is >>so with profiling. > > > Yep, but as I said, the others are much faster. E.g. getString takes > 140ms for 5460 calls, and getInt 570ms for 10920 calls, so its > probably not so much the profiler. getTimestamp() does many more internal method invocations than getInt() so the per-method overhead of your profiler will have a larger effect on getTimestamp(). Consider that some of the utility methods that getTimestamp() calls internally are very small and will be inlined by the JIT in normal operation.. I would try an external benchmark without profiling to get more comparable numbers: record start time, call getTimestamp() 1000000 times, record end time; repeat for getInt(). A warmup loop is a good idea too if you want to measure the JITted performance, 8000 invocations is not much in terms of what the JIT does. > Also, I was merely asking whether there is something that could be > done to bring getTimestamp at least in the same region. There is no simple go-faster change I know of. Then again I've not heard of any performance problems in this area before. If you do come up with some performance-improving changes, by all means post them to the list for integration into the official driver.. -O