Re: TimestampUtils.toString() speedup

From: Kris Jurka <books(at)ejurka(dot)com>
To: Alex Malone <amalone(at)heliumsystems(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: TimestampUtils.toString() speedup
Date: 2007-03-02 18:01:13
Message-ID: Pine.BSO.4.64.0703021259480.30573@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Alex Malone 2007-03-02 18:38:57 Re: TimestampUtils.toString() speedup
Previous Message Alex Malone 2007-03-02 17:03:54 TimestampUtils.toString() speedup