zhengruifeng commented on code in PR #53769:
URL: https://github.com/apache/spark/pull/53769#discussion_r2710847314
##########
python/pyspark/worker.py:
##########
@@ -412,14 +530,17 @@ def get_args(*args: pd.Series):
return zip(*args)
if runner_conf.arrow_concurrency_level > 0:
- from concurrent.futures import ThreadPoolExecutor
@fail_on_stopiteration
def evaluate(*args: pd.Series) -> pd.Series:
- with
ThreadPoolExecutor(max_workers=runner_conf.arrow_concurrency_level) as pool:
- return pd.Series(
- list(pool.map(lambda row: result_func(func(*row)),
get_args(*args)))
Review Comment:
the official
[doc](https://docs.python.org/3/library/concurrent.futures.html) said
> For very long iterables, using a large value for chunksize can
significantly improve performance compared to the default size of 1.
so I guess we should resort to the builtin functionality?
--
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]