Github user neggert commented on the issue:
https://github.com/apache/spark/pull/15018
@srowen Addressed your comments and fixed some style issues.
Some updated timings:
Alternating decreasing input
val x = (1 to length).toArray.map(_.toDouble)
val y = x.reverse.zipWithIndex.map{ case (yi, i) => if (i % 2 == 1) yi
- 1.5 else yi}
Before:
| Input Length | Time (us) |
|-------------:|----------:|
| 100 | 1.4 |
| 200 | 3.0 |
| 400 | 101.8 |
| 800 | 2,010,511.7 |
After:
| Input Length | Time (us) |
|-------------:|----------:|
| 100 | 2.5 |
| 200 | 5.8 |
| 400 | 10.1 |
| 800 | 20.7 |
Pathological input from scikit-learn benchmarks:
val y= ((0 until length) ++ (-(length - 1) until length) ++ (-(length -
1) to 0)).toArray.map(_.toDouble)
val x = (1 to y.length).toArray.map(_.toDouble)
Before:
| Input Length | Time (us) |
|-------------:|----------:|
| 40 | 2.2 |
| 80 | 4.7 |
| 160 | 2140.0 |
| 320 | 3,076,508.1 |
After:
| Input Length | Time (us) |
|-------------:|----------:|
| 40 | 5.3 |
| 80 | 10.4 |
| 160 | 21.3 |
| 320 | 41.9 |
---
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]