]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-117205: Increase chunksize when compiling pyc in parallel (#117206)
authorShantanu <12621235+hauntsaninja@users.noreply.github.com>
Wed, 3 Apr 2024 22:24:24 +0000 (15:24 -0700)
committerGitHub <noreply@github.com>
Wed, 3 Apr 2024 22:24:24 +0000 (15:24 -0700)
Lib/compileall.py
Misc/NEWS.d/next/Library/2024-03-25-00-20-16.gh-issue-117205.yV7xGb.rst [new file with mode: 0644]

index 9b53086bf41380ea6d1e0f3348c77fc29f3dbdac..47e2446356e7d7dd73c163ef6f28d660545ac6c4 100644 (file)
@@ -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 (file)
index 0000000..8d8c201
--- /dev/null
@@ -0,0 +1 @@
+Speed up :func:`compileall.compile_dir` by 20% when using multiprocessing by increasing ``chunksize``.