[ 
https://issues.apache.org/jira/browse/MAHOUT-497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12907389#action_12907389
 ] 

Ted Dunning commented on MAHOUT-497:
------------------------------------


I just committed a change that allocates once, adding cardinality to AM and 
adding rowSize() and columnSize() to Matrix pretty much in 
line with what you suggest.  That the code was ever otherwise was just 
something that I wouldn't have believed until a profiler stuffed
it into my face.

> Matrix get/set causes allocation (?!)
> -------------------------------------
>
>                 Key: MAHOUT-497
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-497
>             Project: Mahout
>          Issue Type: Bug
>            Reporter: Ted Dunning
>
> Matrix get and set check the array bounds.  But checking the array bounds 
> calls size.  But size allocates a small integer
> array.
> This is evil and KILLs performance.
> The first fix is to avoid this in SGD based classifiers.  Second will be a 
> real change to the matrix routines to avoid the allocation.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to