[meld] filediff: Remove process-pool diffing, since it's generally slower



commit 9b50ea406ca535d8fcc310f81183284b8a4fcd41
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Nov 30 06:44:03 2014 +1000

    filediff: Remove process-pool diffing, since it's generally slower
    
    While just using a thread pool here doesn't sidestep the GIL, the
    overhead from doing this process-wise is significant, and the main
    thread just isn't generally doing all that much work other than doing
    the diffs.
    
    Resurrecting the GIL-bypass would still be interesting at some stage,
    but probably as an external C library that did the main diff
    calculation and nothing else.

 meld/filediff.py |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 01bebc7..2ec91df 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -20,7 +20,6 @@ import math
 import os
 import time
 
-from multiprocessing import Pool
 from multiprocessing.pool import ThreadPool
 
 
@@ -67,15 +66,8 @@ class CachedSequenceMatcher(object):
     eviction is overly simplistic, but is okay for our usage pattern.
     """
 
-    process_pool = None
-
     def __init__(self):
-        if self.process_pool is None:
-            if os.name == "nt":
-                CachedSequenceMatcher.process_pool = ThreadPool(None)
-            else:
-                CachedSequenceMatcher.process_pool = Pool(
-                    None, matchers.init_worker, maxtasksperchild=1)
+        self.process_pool = ThreadPool(None)
         self.cache = {}
 
     def match(self, text1, textn, cb):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]