fozziethebeat/S-Space — comment on commit 76ad82b8e972ec6a660561561c325b9aac25a96f
File: src/edu/ucla/sspace/clustering/FastStreamingKMeans.java line 487
By davidjurgens:

The centroid vector might be compared with other vectors multiple times. If we used a ScaledVector here, we would be re-doing this multiplication each time, which is wasted. The centerOfMass is already lazily instantiated, so we know that if we do the computation here we'll be using the results at least once.