[
https://issues.apache.org/jira/browse/MAHOUT-1151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13594860#comment-13594860
]
Sean Owen commented on MAHOUT-1151:
-----------------------------------
I think it would be better to leave the GenericRecommendedItem object immutable
for the reasons Ted mentioned on the mailing list. However if needed a
package-private alterante implementation that is mutable is a fine thing.
Yes I think your implementation is correct. It's a min queue inside, so it
always tracking the smallest top element.
The only small downside here is that you are checking size and comparing to the
head twice, because offer() does it again.
This is all quite similar in spirit to the separate TopItems class FWIW. I
don't know if it's worth combining but it has these ideas embedded already.
> Object reuse in distributed ALS
> -------------------------------
>
> Key: MAHOUT-1151
> URL: https://issues.apache.org/jira/browse/MAHOUT-1151
> Project: Mahout
> Issue Type: Improvement
> Components: Collaborative Filtering
> Affects Versions: 0.8
> Reporter: Sebastian Schelter
> Assignee: Sebastian Schelter
> Attachments: MAHOUT-1151.patch
>
>
> In order to improve the performance our distributed ALS code, we should try
> to avoid object instantiation as much as possible, especially when it is done
> per input tuple.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira