Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id C5BCC9FB7D8 for ; Fri, 2 Mar 2007 14:01:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 43555-08-2 for ; Fri, 2 Mar 2007 14:01:16 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail63.csoft.net (leary.csoft.net [205.205.214.5]) by postgresql.org (Postfix) with SMTP id DD1459FB34E for ; Fri, 2 Mar 2007 14:01:16 -0400 (AST) Received: (qmail 3905 invoked by uid 1112); 2 Mar 2007 18:01:14 -0000 Date: Fri, 2 Mar 2007 13:01:13 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Alex Malone cc: pgsql-jdbc@postgresql.org Subject: Re: TimestampUtils.toString() speedup In-Reply-To: <129448.5111.qm@web32909.mail.mud.yahoo.com> Message-ID: References: <129448.5111.qm@web32909.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.031 tagged_above=0 required=5 tests=AWL, BAYES_50 X-Spam-Level: X-Archive-Number: 200703/19 X-Sequence-Number: 16733 On Fri, 2 Mar 2007, Alex Malone wrote: > Here is a small change that improved the performance of setting a > timestamp field on a prepared statement from 0.513ms to 0.083ms in our > tests. Measured using JProfiler for 50,000 iterations. Essentially it > is switching to use SimpleDateFormat for toString(). I believe this > code is from the 8.1 408 driver. > > pgdtf.format(cal.getTime(), sbuf, FIRSTPOS); Doesn't this leave out the nanoseconds? The Calendar won't have anything below milliseconds. Kris Jurka