From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Wed, 3 Apr 2024 22:24:24 +0000 (-0700) Subject: gh-117205: Increase chunksize when compiling pyc in parallel (#117206) X-Git-Tag: v3.13.0a6~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b4fe02f595fcb9f78261920a268ef614821ec195;p=thirdparty%2FPython%2Fcpython.git gh-117205: Increase chunksize when compiling pyc in parallel (#117206) --- diff --git a/Lib/compileall.py b/Lib/compileall.py index 9b53086bf413..47e2446356e7 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 000000000000..8d8c201afd29 --- /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``.