Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 86908 invoked from network); 2 Aug 2006 21:30:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Aug 2006 21:30:48 -0000 Received: (qmail 13881 invoked by uid 500); 2 Aug 2006 21:30:46 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 13830 invoked by uid 500); 2 Aug 2006 21:30:45 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 13818 invoked by uid 99); 2 Aug 2006 21:30:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2006 14:30:45 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of vstrigun@gmail.com designates 64.233.184.236 as permitted sender) Received: from [64.233.184.236] (HELO wr-out-0506.google.com) (64.233.184.236) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Aug 2006 14:30:44 -0700 Received: by wr-out-0506.google.com with SMTP id 69so429271wra for ; Wed, 02 Aug 2006 14:30:23 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=mlgHhkcKFUs1KKbYWqY8W5OWvvbFEiG9yafgypHT5Yy6pa9ZcBmRY7pmqjp1xEQAEcTiyADmCkPqBeOhG0b9/33ACKgQXLR0sbljtIGW4YZv4tHQz3eIVB7J9do2xkaYLTDuto3eMzc5RFb0wRRxjcO0E1IvPy3fycCTrR5B6Mg= Received: by 10.78.193.19 with SMTP id q19mr527707huf; Wed, 02 Aug 2006 14:30:22 -0700 (PDT) Received: by 10.78.148.13 with HTTP; Wed, 2 Aug 2006 14:30:21 -0700 (PDT) Message-ID: Date: Thu, 3 Aug 2006 01:30:22 +0400 From: "Vladimir Strigun" To: harmony-dev@incubator.apache.org Subject: Re: [classlib][java.math] combination of math packages In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Daniel, thank you for the analysis of our patch. Now I think we all should vote for our combined version and put it to SVN as default one. Thanks, Vladimir. On 8/2/06, Daniel Fridlender wrote: > Vladimir, > > thank you very much for reviewing H-935 and improving it. It shows > significantly better performance for BigDecimal that fit in 64 bits > with no harm for the remaining cases. > > I agree with the changes you have made and are willing to continue > improving our common math from now on. > > Thanks a lot! > > Daniel > > > On 8/1/06, Vladimir Strigun wrote: > > Daniel, > > > > Thank you for the new optimized version. We've analyzed your version > > and found it's very good. We can accept you version as default for > > Harmony but we'd like to add some improvements. :) > > > > I've updated H-935 and attach diffs for your code. We added > > optimization for small BigDecimal's objects. Our patch doesn't break > > your design covers the following issues: > > - reduce amount of object created during initialization of BigDecimal. > > In our version we don't use BigInteger during BigDecimal creation for > > small values. > > - cached values for powers of tens and for powers of five were added. > > - additional branches in all calculation methods for supporting small > > value calculations as well. > > - toDecimalScaledString method was added to Conversion class. The > > method is intended only for processing 32-bits numbers. > > > > I've attached small micro bench that shows boost for BigDecimal that > > fits to 64 bits. I should mention that we can't see any degradation in > > all other performance tests with our patch. > > > > Daniel, could you please review our patch? If you agree with suggested > > changes, I believe we all will vote +1 for our common math :) > > > > Thanks, > > Vladimir. > > > > > > -- > > Vladimir Strigun, > > Intel Middleware Product Division > > > > > > > > On 7/21/06, Daniel Fridlender wrote: > > > Dear all, > > > > > > On behalf of ITC, I have submitted as H-935 a new implementation of > > > java.math combining previously donated implementations. It includes > > > what we think are the best features of H-380 (donated by Intel) and > > > the best features of H-199 (donated by ITC). We have also fixed some > > > bugs from both implementations and done some further optimizations on > > > methods from both of them. > > > > > > We have also included a few optimizations from H-551, we expect to > > > include the remaining optimizations soon. We have also improved the > > > performance test suite from H-551 and included further tests, among > > > them realistic applications from cryptography. Check the README file > > > included in the package mathPerformanceTestsUpdate.zip (H-935) for > > > some more details about the new features of the test suite. > > > > > > A sample of the output obtained with the performance test suite can be > > > found at http://www.fitc.unc.edu.ar/javadev/math/benchmarking.html > > > > > > A comparative analysis on a method-by-method basis between H-380 and > > > H-199 can be found at > > > http://www.fitc.unc.edu.ar/javadev/math/docs.html > > > > > > We will include further documentation soon. In the meantime, a brief > > > description of the main issues follows: > > > > > > Internal representation of BigInteger: taken from H-380 > > > (Sign-magnitude representation). > > > Design: taken from H-199 (well-defined static libraries grouped by > > > functionality). > > > Serialization: taken from H-380 (it was not implemented in H-199). > > > > > > Most methods and constructors were taken from one of the previous > > > donations and then tuned for consistency with the internal > > > representation, for bug removal and for further optimizations. Very > > > often large parts were reprogrammed (e.g.: shiftRight, bitLength, > > > bitCount, not, setTrueCoded, modInverse, and many more). > > > > > > Nevertheless we can roughly say that the new version started by taking: > > > > > > 1) Methods of BigDecimal: most of them from H-199 because of efficiency. > > > 2) Representation-dependent methods of BigInteger: most of them from H-380. > > > 3) Representation-independent methods of BigInteger: most of them from > > > H-199 for efficiency. > > > 4) From H-551: caches, BigInteger.compareArrays, BigInteger.valueOf, > > > BigDecimal.valueOf, etc. We also took their performance test suite, > > > improve it and added further benchmarks. > > > > > > We plan to introduce remaining optimizations from H-551 and to > > > optimize other methods (modPow, modInverse, nextProbablePrime, etc.) > > > in order to bridge the gap in efficiency with the RI. > > > > > > Best regards, > > > > > > Daniel Fridlender > > > ITC > > > > > > http://issues.apache.org/jira/browse/HARMONY-935 > > > > > > --------------------------------------------------------------------- > > > Terms of use : http://incubator.apache.org/harmony/mailing.html > > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > > > For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > > > > > > > > > --------------------------------------------------------------------- > > Terms of use : http://incubator.apache.org/harmony/mailing.html > > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > > For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > > > > > --------------------------------------------------------------------- > Terms of use : http://incubator.apache.org/harmony/mailing.html > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org For additional commands, e-mail: harmony-dev-help@incubator.apache.org