apache/mahout — pull request #17 by sscdotopen (2014-06-13 14:22:01+00:00)
Title: MAHOUT-1580 Optimize getNumNonZeroElements()

Can someone have a look at the changes? The basic idea is to directly work on the internal datastructures instead of going through the non-zeroes iterator.

A quick benchmark should 7x performance on dense and 3x performance on sequential access sparse vectors.