Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 70BAC70FF for ; Mon, 1 Aug 2011 05:18:16 +0000 (UTC) Received: (qmail 76712 invoked by uid 500); 1 Aug 2011 05:18:10 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 76240 invoked by uid 500); 1 Aug 2011 05:17:58 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 76229 invoked by uid 99); 1 Aug 2011 05:17:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2011 05:17:51 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of phil.steitz@gmail.com designates 74.125.83.43 as permitted sender) Received: from [74.125.83.43] (HELO mail-gw0-f43.google.com) (74.125.83.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Aug 2011 05:17:42 +0000 Received: by gwm11 with SMTP id 11so3787458gwm.30 for ; Sun, 31 Jul 2011 22:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=IYrQjwY3tnPgJq36siRGqUOruAc7L0v3pnLutY4Q7mI=; b=pSWBlcxjtLAQ0r4iqx053/bTVBmh07QV0Q+cU59BaUmo/SI7csf+ONKNNsAFsim1mq E3u6gfVEZ0AyGdMewUczlAcVeIyQ6FAO7BUQAAMVVfFifxp/WF5VINCe+DhHZ2ZwrVNt OrMRiXPicEXcP0d4nqUZOd3kCQMpecn3aRz/I= Received: by 10.142.194.4 with SMTP id r4mr2527443wff.259.1312175840773; Sun, 31 Jul 2011 22:17:20 -0700 (PDT) Received: from [192.168.0.2] (71-223-74-208.phnx.qwest.net [71.223.74.208]) by mx.google.com with ESMTPS id z16sm515940wff.10.2011.07.31.22.17.17 (version=SSLv3 cipher=OTHER); Sun, 31 Jul 2011 22:17:18 -0700 (PDT) Message-ID: <4E3636DB.3000800@gmail.com> Date: Sun, 31 Jul 2011 22:17:15 -0700 From: Phil Steitz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Commons Developers List Subject: [math] Improving tests and performance of RandomGenerator implementations Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org In my own applications, I noticed what appears to be poor performance in the nextInt(int) method of the Mersenne twister, which I was using to *improve* speed. I think that for small n, the default implementation in BistreamGenerator may be running too many iterations. I am still figuring out how the code works, but I thought it would be good to run some benchmarks - using Gilles' new stuff - against the Harmony implementation in java.util.Random of this method. That led me to notice that there are no unit tests for BitstreamGenerator. I propose that we add 0) RandomGeneratorAbstractTest with an abstract makeGenerator method including fixed seed tests for all RandomGenerator methods 1) BitstreamGeneratorTest extending RandomGeneratorAbstractTest implementing makeGenerator with a BitStreamGenerator that uses the JDK generator for next(int) 2) Make the test classes for Mersenne and Weil generators extend RandomGeneratorAbstractTest, moving redundant tests up into the base class Sound reasonable? Also, any recollection why we are using a different implementation in BitStreamGenerator for next(int) than Harmony and the JDK use? The Harmony impl is almost identical to what is documented in the JDK javadoc. Phil --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org