Github user BryanCutler commented on a diff in the pull request: https://github.com/apache/spark/pull/18281#discussion_r122007474 --- Diff: mllib/src/main/scala/org/apache/spark/ml/classification/OneVsRest.scala --- @@ -325,8 +350,13 @@ final class OneVsRest @Since("1.4.0") ( multiclassLabeled.persist(StorageLevel.MEMORY_AND_DISK) } + val iters = Range(0, numClasses).par + iters.tasksupport = new ForkJoinTaskSupport( + new ForkJoinPool(Math.min(getParallelism, numClasses)) --- End diff -- I don't think `ForkJoinPool` is the best thing to use here. It's more geared for a bunch of small tasks that might spawn other tasks. Just a regular thread-pool is fine. Also, it is a little better for the case of `parallelism` 1 to use `sameThreadExecutor`. This will just run in the current thread and has no overhead (equivalent to running in serial), where a thread-pool of size 1 will still create another thread and does have some overhead.
--- 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