From 1f65c9e17cd9d8ab5fcbc71ecfab8c0f3ba6ef5d Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 24 Mar 2024 17:07:46 -0700 Subject: [PATCH 1/2] Increase chunksize when compiling pyc in parallel --- Lib/compileall.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: From 5bf581a76b2337ce0d76d40f32799af7bd1df8a2 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 00:20:19 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2024-03-25-00-20-16.gh-issue-117205.yV7xGb.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2024-03-25-00-20-16.gh-issue-117205.yV7xGb.rst 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``.