Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 11322 invoked from network); 30 Jan 2007 15:41:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Jan 2007 15:41:55 -0000 Received: (qmail 19950 invoked by uid 500); 30 Jan 2007 15:42:01 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 19916 invoked by uid 500); 30 Jan 2007 15:42:00 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 19906 invoked by uid 99); 30 Jan 2007 15:42:00 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jan 2007 07:42:00 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Jan 2007 07:41:54 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id F3C7B7142D7 for ; Tue, 30 Jan 2007 07:41:33 -0800 (PST) Message-ID: <10917503.1170171693994.JavaMail.jira@brutus> Date: Tue, 30 Jan 2007 07:41:33 -0800 (PST) From: "Evgeniya Maenkova (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-3089) [math] performance related improvements in java.math.BigDecimal/java.math.BigInteger/java.math. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [math] performance related improvements in java.math.BigDecimal/java.math.BigInteger/java.math. ----------------------------------------------------------------------------------------------- Key: HARMONY-3089 URL: https://issues.apache.org/jira/browse/HARMONY-3089 Project: Harmony Issue Type: Bug Components: Classlib Reporter: Evgeniya Maenkova Attachments: math.impr.patch Several performance related proposals for java.math: 1) move Conversion.string2BigInteger(val, radix) to BigInteger. This method is called only from BigInteger(String, int) . So if we move this into BigInteger redudant object will not be created. 2) precision computation is pretty difficult, so (a) in inplaceRound we could add additional check to use approx precision; (b) if BigDecimal is constructed from char[] we could compute precision pretty cheaply. 3) as you know, if we work with small BigDecimals we use longs. Looks like this feature is missed in BigDecimal(char[], int, int). So let's keep this idea there also. 4) very small: let's use StringBuilder instead of StringBuffer in BigDecimal(char[] in, int offset, int len). We don't need such kind of synchronization there so let's use StringBuilder. >From spec(StringBuffer): "As of release JDK 5, this class has been supplemented with an equivalent class designed for use by a single thread, StringBuilder. The StringBuilder class should generally be used in preference to this one, as it supports all of the same operations but it is faster, as it performs no synchronization. . " -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.