https://github.com/python/cpython/commit/b4fe02f595fcb9f78261920a268ef614821ec195
commit: b4fe02f595fcb9f78261920a268ef614821ec195
branch: main
author: Shantanu <[email protected]>
committer: hauntsaninja <[email protected]>
date: 2024-04-03T15:24:24-07:00
summary:
gh-117205: Increase chunksize when compiling pyc in parallel (#117206)
files:
A Misc/NEWS.d/next/Library/2024-03-25-00-20-16.gh-issue-117205.yV7xGb.rst
M Lib/compileall.py
diff --git a/Lib/compileall.py b/Lib/compileall.py
index 9b53086bf41380..47e2446356e7d7 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -116,7 +116,8 @@ def compile_dir(dir, maxlevels=None, ddir=None, force=False,
prependdir=prependdir,
limit_sl_dest=limit_sl_dest,
hardlink_dupes=hardlink_dupes),
- files)
+ files,
+ chunksize=4)
success = min(results, default=True)
else:
for file in files:
diff --git
a/Misc/NEWS.d/next/Library/2024-03-25-00-20-16.gh-issue-117205.yV7xGb.rst
b/Misc/NEWS.d/next/Library/2024-03-25-00-20-16.gh-issue-117205.yV7xGb.rst
new file mode 100644
index 00000000000000..8d8c201afd29fb
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2024-03-25-00-20-16.gh-issue-117205.yV7xGb.rst
@@ -0,0 +1 @@
+Speed up :func:`compileall.compile_dir` by 20% when using multiprocessing by
increasing ``chunksize``.
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]