You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Phil Steitz (JIRA)" <ji...@apache.org> on 2015/07/17 22:50:04 UTC

[jira] [Commented] (MATH-1250) ANN: add performance reporting

    [ https://issues.apache.org/jira/browse/MATH-1250?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14631880#comment-14631880 ] 

Phil Steitz commented on MATH-1250:
-----------------------------------

In the computeUpdateRatio method, 'successful' is mis-spelled in the javadoc.  Also, I am not familiar with this code, but if the intent is for it to be executed concurrently, the setup you have doesn't guarantee consistent results.  Having two separate atomic longs and no sync protection around updates or reads from them means that computations based on their values may be inconsistent.  It is possible, for example, that the for loop inside computeUpdateRatio gets the result of an increment to  numberOfAttemptedUpdates, but not the subsequent increment to numberOfSuccessfulUpdates.  If you really want the ratio to be consistent, you need to use longs instead and protect updates to them in a sync block. 

> ANN: add performance reporting
> ------------------------------
>
>                 Key: MATH-1250
>                 URL: https://issues.apache.org/jira/browse/MATH-1250
>             Project: Commons Math
>          Issue Type: Improvement
>    Affects Versions: 3.5
>            Reporter: Gilles
>            Assignee: Gilles
>            Priority: Minor
>              Labels: API
>             Fix For: 4.0, 3.6
>
>         Attachments: MATH-1250.patch
>
>
> The {{Neuron}} objects (package "o.a.c.m.ml.neuralnet") can be updated concurrently.
> In order to figure out whether adding more CPUs to a task will improve or hinder performance, it would be useful to be able to assess how many updates were completed successfully (i.e. without another thread having changed the object's state concurrently).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)