Use an LRU cache for deserialized functions
Fixes
@@ -3021,6 +3021,12 @@ def execute_task(task):
return task
+try:
+ # a 10 MB cache of deserialized functions and their bytes
+ from zict import LRU
+
+ cache = LRU(10000000, dict(), weight=lambda k, v: len(v))
+except ImportError:
cache = dict()
