Github user hqzizania commented on the issue:
https://github.com/apache/spark/pull/13891
@srowen Ops~ The `copytoTri()` is indeed a little different in the test
code. I change it into:
```
private def copyToTri(): Unit = {
var i = 0
var j = 0
var ii = 0
while (i < k) {
val temp = i * k
j = 0
while (j <= i) {
ata(ii) += ata2(temp + j)
j += 1
ii += 1
}
i += 1
}
}
```
And `ls.reset()` added into the loop of doStack as following (also for the
other loop):
```
val t2 = System.nanoTime()
var i = 0
while (i < m) {
ls.reset()
val matrixBuffer = mutable.ArrayBuilder.make[Double]
val bBuffer = mutable.ArrayBuilder.make[Double]
for (s <- 0 until stack) {
for (j <- 0 until n) {
matrixBuffer += matrix(i + s)(j)
}
bBuffer += bVector(i + s)
}
i += stack
ls.addStack(matrixBuffer.result(), bBuffer.result(), stack)
}
val t3 = System.nanoTime()
```
The results are basically the same. Actually `ls.reset()` is used in each
inner loop in `computeFactors` ALS using.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]