Changed the 'multiprocessing.Process()' code of the background batch services to (hopefully) cure the slow down when used multiple times. eric7

Mon, 27 Sep 2021 15:32:56 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 27 Sep 2021 15:32:56 +0200
branch
eric7
changeset 83
7a6fb6e896e0
parent 82
15dfed853c42
child 84
5e1e082b47fa

Changed the 'multiprocessing.Process()' code of the background batch services to (hopefully) cure the slow down when used multiple times.

ChangeLog file | annotate | diff | comparison | revisions
PluginVulture.py file | annotate | diff | comparison | revisions
PluginVulture.zip file | annotate | diff | comparison | revisions
VultureChecker/Documentation/source/Plugin_Checker_Vulture.PluginVulture.html file | annotate | diff | comparison | revisions
VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.EditWhiteListDialog.html file | annotate | diff | comparison | revisions
VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.VultureCheckerDialog.html file | annotate | diff | comparison | revisions
VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.VultureCheckerService.html file | annotate | diff | comparison | revisions
VultureChecker/Documentation/source/index-Plugin_Checker_Vulture.VultureChecker.html file | annotate | diff | comparison | revisions
VultureChecker/Documentation/source/index-Plugin_Checker_Vulture.html file | annotate | diff | comparison | revisions
VultureChecker/Documentation/source/index.html file | annotate | diff | comparison | revisions
VultureChecker/Documentation/source/styles.css file | annotate | diff | comparison | revisions
VultureChecker/VultureCheckerService.py file | annotate | diff | comparison | revisions
diff -r 15dfed853c42 -r 7a6fb6e896e0 ChangeLog
--- a/ChangeLog	Sun Jun 27 12:46:48 2021 +0200
+++ b/ChangeLog	Mon Sep 27 15:32:56 2021 +0200
@@ -1,5 +1,8 @@
 ChangeLog
 ---------
+Version 1.0.1:
+- bug fixes
+
 Version 1.0.0:
 - first release of the eric7 variant
 
diff -r 15dfed853c42 -r 7a6fb6e896e0 PluginVulture.py
--- a/PluginVulture.py	Sun Jun 27 12:46:48 2021 +0200
+++ b/PluginVulture.py	Mon Sep 27 15:32:56 2021 +0200
@@ -22,7 +22,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "1.0.0"
+version = "1.0.1"
 className = "VulturePlugin"
 packageName = "VultureChecker"
 shortDescription = "Plug-in to detect unused code using the 'vulture' library"
diff -r 15dfed853c42 -r 7a6fb6e896e0 PluginVulture.zip
Binary file PluginVulture.zip has changed
diff -r 15dfed853c42 -r 7a6fb6e896e0 VultureChecker/Documentation/source/Plugin_Checker_Vulture.PluginVulture.html
--- a/VultureChecker/Documentation/source/Plugin_Checker_Vulture.PluginVulture.html	Sun Jun 27 12:46:48 2021 +0200
+++ b/VultureChecker/Documentation/source/Plugin_Checker_Vulture.PluginVulture.html	Mon Sep 27 15:32:56 2021 +0200
@@ -2,21 +2,7 @@
 <html><head>
 <title>Plugin_Checker_Vulture.PluginVulture</title>
 <meta charset="UTF-8">
-<style>
-body {
-    background: #EDECE6;
-    margin: 0em 1em 10em 1em;
-    color: black;
-}
-
-h1 { color: white; background: #85774A; }
-h2 { color: white; background: #85774A; }
-h3 { color: white; background: #9D936E; }
-h4 { color: white; background: #9D936E; }
-    
-a { color: #BA6D36; }
-
-</style>
+<link rel="stylesheet" href="styles.css">
 </head>
 <body>
 <a NAME="top" ID="top"></a>
diff -r 15dfed853c42 -r 7a6fb6e896e0 VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.EditWhiteListDialog.html
--- a/VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.EditWhiteListDialog.html	Sun Jun 27 12:46:48 2021 +0200
+++ b/VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.EditWhiteListDialog.html	Mon Sep 27 15:32:56 2021 +0200
@@ -2,21 +2,7 @@
 <html><head>
 <title>Plugin_Checker_Vulture.VultureChecker.EditWhiteListDialog</title>
 <meta charset="UTF-8">
-<style>
-body {
-    background: #EDECE6;
-    margin: 0em 1em 10em 1em;
-    color: black;
-}
-
-h1 { color: white; background: #85774A; }
-h2 { color: white; background: #85774A; }
-h3 { color: white; background: #9D936E; }
-h4 { color: white; background: #9D936E; }
-    
-a { color: #BA6D36; }
-
-</style>
+<link rel="stylesheet" href="styles.css">
 </head>
 <body>
 <a NAME="top" ID="top"></a>
diff -r 15dfed853c42 -r 7a6fb6e896e0 VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.VultureCheckerDialog.html
--- a/VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.VultureCheckerDialog.html	Sun Jun 27 12:46:48 2021 +0200
+++ b/VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.VultureCheckerDialog.html	Mon Sep 27 15:32:56 2021 +0200
@@ -2,21 +2,7 @@
 <html><head>
 <title>Plugin_Checker_Vulture.VultureChecker.VultureCheckerDialog</title>
 <meta charset="UTF-8">
-<style>
-body {
-    background: #EDECE6;
-    margin: 0em 1em 10em 1em;
-    color: black;
-}
-
-h1 { color: white; background: #85774A; }
-h2 { color: white; background: #85774A; }
-h3 { color: white; background: #9D936E; }
-h4 { color: white; background: #9D936E; }
-    
-a { color: #BA6D36; }
-
-</style>
+<link rel="stylesheet" href="styles.css">
 </head>
 <body>
 <a NAME="top" ID="top"></a>
diff -r 15dfed853c42 -r 7a6fb6e896e0 VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.VultureCheckerService.html
--- a/VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.VultureCheckerService.html	Sun Jun 27 12:46:48 2021 +0200
+++ b/VultureChecker/Documentation/source/Plugin_Checker_Vulture.VultureChecker.VultureCheckerService.html	Mon Sep 27 15:32:56 2021 +0200
@@ -2,21 +2,7 @@
 <html><head>
 <title>Plugin_Checker_Vulture.VultureChecker.VultureCheckerService</title>
 <meta charset="UTF-8">
-<style>
-body {
-    background: #EDECE6;
-    margin: 0em 1em 10em 1em;
-    color: black;
-}
-
-h1 { color: white; background: #85774A; }
-h2 { color: white; background: #85774A; }
-h3 { color: white; background: #9D936E; }
-h4 { color: white; background: #9D936E; }
-    
-a { color: #BA6D36; }
-
-</style>
+<link rel="stylesheet" href="styles.css">
 </head>
 <body>
 <a NAME="top" ID="top"></a>
@@ -64,7 +50,7 @@
 <td>Private function to analyze one file.</td>
 </tr>
 <tr>
-<td><a href="#worker">worker</a></td>
+<td><a href="#workerTask">workerTask</a></td>
 <td>Module function acting as the parallel worker for the vulture check.</td>
 </tr>
 </table>
@@ -286,9 +272,9 @@
 <div align="right"><a href="#top">Up</a></div>
 <hr />
 <hr />
-<a NAME="worker" ID="worker"></a>
-<h2>worker</h2>
-<b>worker</b>(<i>inputQueue, outputQueue</i>)
+<a NAME="workerTask" ID="workerTask"></a>
+<h2>workerTask</h2>
+<b>workerTask</b>(<i>inputQueue, outputQueue</i>)
 
 <p>
     Module function acting as the parallel worker for the vulture check.
diff -r 15dfed853c42 -r 7a6fb6e896e0 VultureChecker/Documentation/source/index-Plugin_Checker_Vulture.VultureChecker.html
--- a/VultureChecker/Documentation/source/index-Plugin_Checker_Vulture.VultureChecker.html	Sun Jun 27 12:46:48 2021 +0200
+++ b/VultureChecker/Documentation/source/index-Plugin_Checker_Vulture.VultureChecker.html	Mon Sep 27 15:32:56 2021 +0200
@@ -2,21 +2,7 @@
 <html><head>
 <title>Plugin_Checker_Vulture.VultureChecker</title>
 <meta charset="UTF-8">
-<style>
-body {
-    background: #EDECE6;
-    margin: 0em 1em 10em 1em;
-    color: black;
-}
-
-h1 { color: white; background: #85774A; }
-h2 { color: white; background: #85774A; }
-h3 { color: white; background: #9D936E; }
-h4 { color: white; background: #9D936E; }
-    
-a { color: #BA6D36; }
-
-</style>
+<link rel="stylesheet" href="styles.css">
 </head>
 <body>
 <h1>Plugin_Checker_Vulture.VultureChecker</h1>
diff -r 15dfed853c42 -r 7a6fb6e896e0 VultureChecker/Documentation/source/index-Plugin_Checker_Vulture.html
--- a/VultureChecker/Documentation/source/index-Plugin_Checker_Vulture.html	Sun Jun 27 12:46:48 2021 +0200
+++ b/VultureChecker/Documentation/source/index-Plugin_Checker_Vulture.html	Mon Sep 27 15:32:56 2021 +0200
@@ -2,21 +2,7 @@
 <html><head>
 <title>Plugin_Checker_Vulture</title>
 <meta charset="UTF-8">
-<style>
-body {
-    background: #EDECE6;
-    margin: 0em 1em 10em 1em;
-    color: black;
-}
-
-h1 { color: white; background: #85774A; }
-h2 { color: white; background: #85774A; }
-h3 { color: white; background: #9D936E; }
-h4 { color: white; background: #9D936E; }
-    
-a { color: #BA6D36; }
-
-</style>
+<link rel="stylesheet" href="styles.css">
 </head>
 <body>
 <h1>Plugin_Checker_Vulture</h1>
diff -r 15dfed853c42 -r 7a6fb6e896e0 VultureChecker/Documentation/source/index.html
--- a/VultureChecker/Documentation/source/index.html	Sun Jun 27 12:46:48 2021 +0200
+++ b/VultureChecker/Documentation/source/index.html	Mon Sep 27 15:32:56 2021 +0200
@@ -2,21 +2,7 @@
 <html><head>
 <title>Table of contents</title>
 <meta charset="UTF-8">
-<style>
-body {
-    background: #EDECE6;
-    margin: 0em 1em 10em 1em;
-    color: black;
-}
-
-h1 { color: white; background: #85774A; }
-h2 { color: white; background: #85774A; }
-h3 { color: white; background: #9D936E; }
-h4 { color: white; background: #9D936E; }
-    
-a { color: #BA6D36; }
-
-</style>
+<link rel="stylesheet" href="styles.css">
 </head>
 <body>
 <h1>Table of contents</h1>
diff -r 15dfed853c42 -r 7a6fb6e896e0 VultureChecker/Documentation/source/styles.css
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VultureChecker/Documentation/source/styles.css	Mon Sep 27 15:32:56 2021 +0200
@@ -0,0 +1,12 @@
+body {
+    color: black;
+    background: #EDECE6;
+    margin: 0em 1em 10em 1em;
+}
+
+h1 { color: white; background: #85774A; }
+h2 { color: white; background: #85774A; }
+h3 { color: white; background: #9D936E; }
+h4 { color: white; background: #9D936E; }
+    
+a { color: #BA6D36; }
diff -r 15dfed853c42 -r 7a6fb6e896e0 VultureChecker/VultureCheckerService.py
--- a/VultureChecker/VultureCheckerService.py	Sun Jun 27 12:46:48 2021 +0200
+++ b/VultureChecker/VultureCheckerService.py	Mon Sep 27 15:32:56 2021 +0200
@@ -81,9 +81,13 @@
         taskQueue.put(task)
 
     # Start worker processes
-    for _ in range(NumberOfProcesses):
-        multiprocessing.Process(target=worker,
-                                args=(taskQueue, doneQueue)).start()
+    workers = [
+        multiprocessing.Process(
+            target=workerTask, args=(taskQueue, doneQueue)
+        ) for _ in range(NumberOfProcesses)
+    ]
+    for worker in workers:
+        worker.start()
 
     # Get and send results
     endIndex = len(argumentsList) - initialTasks
@@ -113,9 +117,13 @@
     # Tell child processes to stop
     for _ in range(NumberOfProcesses):
         taskQueue.put('STOP')
+    
+    for worker in workers:
+        worker.join()
+        worker.close()
 
 
-def worker(inputQueue, outputQueue):
+def workerTask(inputQueue, outputQueue):
     """
     Module function acting as the parallel worker for the vulture check.
     

eric ide

mercurial