[diffoscope] 02/02: Memoize calls to ``distutils.spawn.find_executable`` to avoid excessive stat(1) syscalls.

Chris Lamb chris at chris-lamb.co.uk
Wed Dec 7 15:14:03 CET 2016


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository diffoscope.

commit 3d0d70c0ecffe1adea1e76ca9e97579e8ebb3079
Author: Chris Lamb <lamby at debian.org>
Date:   Wed Dec 7 14:10:02 2016 +0000

    Memoize calls to ``distutils.spawn.find_executable`` to avoid excessive stat(1) syscalls.
---
 diffoscope/__init__.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/diffoscope/__init__.py b/diffoscope/__init__.py
index bb27260..b1bb1d4 100644
--- a/diffoscope/__init__.py
+++ b/diffoscope/__init__.py
@@ -52,6 +52,10 @@ def get_current_os():
     return system
 
 
+# Memoize calls to ``distutils.spawn.find_executable`` to avoid excessive stat
+# calls
+find_executable = functools.lru_cache()(find_executable)
+
 def tool_required(command):
     """
     Decorator that checks if the specified tool is installed

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list