Github user MLnick commented on the issue: https://github.com/apache/spark/pull/18748 I don't get similar results to you (granted I have just tested locally). ``` scala> spark.time { userRecsAll.foreach(_ => Unit) } Time taken: 122422 ms scala> spark.time { userRecsPart.foreach(_ => Unit) } Time taken: 50228 ms ``` Here, `userRecsPart` is a 30% sample, and the time is ~40% of the `recommendForAllUsers` time. I will try some larger-scale tests. It could be that the `join` and `distinct` causes the underperformance. However, those operations would increase the number of partitions in the computation a lot due to `spark.sql.shuffle.partitions` setting if using defaults. Setting this to say `8` (the number of threads I have locally), I get ``` scala> spark.time { userRecsPart.foreach(_ => Unit) } Time taken: 37362 ms ``` So, about 30% of the full time for the 30% sample.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org