Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 98345 invoked from network); 10 Aug 2004 21:27:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Aug 2004 21:27:45 -0000 Received: (qmail 18035 invoked by uid 500); 10 Aug 2004 21:27:39 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 17972 invoked by uid 500); 10 Aug 2004 21:27:39 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 17959 invoked by uid 99); 10 Aug 2004 21:27:39 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [12.6.96.143] (HELO ns1018.seagullsoftware.com) (12.6.96.143) by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 10 Aug 2004 14:27:35 -0700 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [lang] FastNumberFormat? X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Date: Tue, 10 Aug 2004 17:27:30 -0400 Message-ID: <2B64219028BBFF48B3CC957EF10B58FE0E1B7E@ns1018.SSSI.seagull.nl> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [lang] FastNumberFormat? Thread-Index: AcR/H68aNHCquJ0IRI2DtAhukfarrQAAQIig From: "Gary Gregory" To: "Jakarta Commons Users List" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Why not give each thread its own DecimalFormat instance in a thread local variable? Then you do not have to worry about it. Gary > -----Original Message----- > From: Martin Cooper [mailto:mfncooper@gmail.com] > Sent: Tuesday, August 10, 2004 14:19 > To: Jakarta Commons Users List > Subject: Re: [lang] FastNumberFormat? >=20 > On Tue, 10 Aug 2004 22:23:11 +0200, Andreas Schildbach > wrote: > > > > > > Martin Cooper wrote: > > > > > Is there a fast version of java.text.NumberFormat hiding somewhere in > > > Commons Lang that I haven't been able to find? The JDK version of > > > format() actually does synchronisation, and I'm calling it enough that > > > this hurts. > > > > Are you sure that it synchronizes? > > > > From the NumberFormat JavaDoc: > > > > "Number formats are generally not synchronized. It is recommended to > > create separate format instances for each thread. If multiple threads > > access a format concurrently, it must be synchronized externally." >=20 > I misspoke slightly - it's DecimalFormat that synchronises, not > NumberFormat. And yes, I'm sure, despite the JavaDoc for DecimalFormat > saying the exact same thing. I looked at the source code, and it's > synchronising on a buffer. Yuk! >=20 > -- > Martin Cooper >=20 >=20 > > > > Regards, > > > > Andreas > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > > > >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org