Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9C39317F25 for ; Tue, 7 Oct 2014 15:19:34 +0000 (UTC) Received: (qmail 78076 invoked by uid 500); 7 Oct 2014 15:19:34 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 77981 invoked by uid 500); 7 Oct 2014 15:19:34 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 77966 invoked by uid 99); 7 Oct 2014 15:19:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Oct 2014 15:19:34 +0000 Date: Tue, 7 Oct 2014 15:19:34 +0000 (UTC) From: "Thomas Neidhart (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MATH-1154) Statistical tests in stat.inference package are very slow due to implicit RandomGenerator initialization MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MATH-1154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14161993#comment-14161993 ] Thomas Neidhart commented on MATH-1154: --------------------------------------- Well, I know it is pointless to discuss anything with you as you will never acknowledge anything else than your POV. {quote} I'm proposing to tidy up things and process them in order, and you keep ignoring the suggestion. If you and the OP want to resolve this issue, then there is only one alternative at present: Your fix. Please apply it and let's move on to the other suggestions. {quote} but I can not leave this statement as is, how do I ignore anything or do not process things in a reasonable way? I did the following: * attach a clean patch so solve the original issue at hand that does not require additional changes (open for discussion, I did not apply it) * create a separate issue to address the potential performance improvements for existing rngs * re-open the original issue that was referred to by the OP and suggested to discuss the potential solutions (as currently attached to this issue) on the ml I mean, seriously, I am fed up with discussions like this. > Statistical tests in stat.inference package are very slow due to implicit RandomGenerator initialization > -------------------------------------------------------------------------------------------------------- > > Key: MATH-1154 > URL: https://issues.apache.org/jira/browse/MATH-1154 > Project: Commons Math > Issue Type: Bug > Affects Versions: 3.3 > Reporter: Otmar Ertl > Attachments: MATH-1154.patch, math3.patch > > > Some statistical tests defined in the stat.inference package (e.g. BinomialTest or ChiSquareTest) are unnecessarily very slow (up to a factor 20 slower than necessary). The reason is the implicit slow initialization of a default (Well19937c) random generator instance each time a test is performed. The affected tests create some distribution instance in order to use some methods defined therein. However, they do not use any method for random generation. Nevertheless a random number generator instance is automatically created when creating a distribution instance, which is the reason for the serious slowdown. The problem is related to MATH-1124. > There are following solutions: > 1) Fix the affected statistical tests by passing a light-weight RandomGenerator implementation (or even null) to the constructor of the distribution. > 2) Or use for all distributions a RandomGenerator implementation that uses lazy initialization to generate the Well19937c instance as late as possible. This would also solve MATH-1124. > I will attach a patch proposal together with a performance test, that will demonstrate the speed up after a fix. -- This message was sent by Atlassian JIRA (v6.3.4#6332)