dongjoon-hyun commented on code in PR #55552:
URL: https://github.com/apache/spark/pull/55552#discussion_r3155628382


##########
core/src/main/scala/org/apache/spark/api/python/PythonRunner.scala:
##########
@@ -121,6 +121,15 @@ private[spark] object PythonEvalType {
 
 private[spark] object BasePythonRunner extends Logging {
 
+  /**
+   * Shared thread pool for pipelined writer tasks. Using a cached thread pool 
ensures that
+   * writer threads are reused across tasks, which keeps JIT-compiled code, 
branch prediction
+   * history, and CPU caches warm. This avoids the 2-3x serialization slowdown 
observed when
+   * using freshly created threads.
+   */
+  private[python] lazy val pipelinedWriterThreadPool =
+    ThreadUtils.newDaemonCachedThreadPool("python-udf-pipelined-writer")

Review Comment:
   What is the maximum size of this thread pool, can we have a bounded thread 
pool?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to