[diffoscope] 03/05: Profile container extraction, opening and closing times.

Chris Lamb chris at chris-lamb.co.uk
Fri Dec 23 12:46:22 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 a543efefeb89f650a060680e3653aa9a7178a79f
Author: Chris Lamb <lamby at debian.org>
Date:   Fri Dec 23 11:36:36 2016 +0000

    Profile container extraction, opening and closing times.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 diffoscope/comparators/utils.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/diffoscope/comparators/utils.py b/diffoscope/comparators/utils.py
index e114de8..1a4b9ca 100644
--- a/diffoscope/comparators/utils.py
+++ b/diffoscope/comparators/utils.py
@@ -32,6 +32,7 @@ import diffoscope.comparators
 from diffoscope import logger, tool_required, get_temporary_directory
 from diffoscope.config import Config
 from diffoscope.progress import Progress
+from diffoscope.profiling import profile
 from diffoscope.comparators.binary import File, NonExistingFile
 
 
@@ -256,7 +257,8 @@ class ArchiveMember(File):
             logger.debug('unpacking %s', self._name)
             assert self._temp_dir is None
             self._temp_dir = get_temporary_directory()
-            self._path = self.container.extract(self._name, self._temp_dir.name)
+            with profile('container_extract', self.container):
+                self._path = self.container.extract(self._name, self._temp_dir.name)
         return self._path
 
     def cleanup(self):
@@ -286,10 +288,12 @@ class Archive(Container, metaclass=abc.ABCMeta):
 
     def __init__(self, *args, **kwargs):
         super().__init__(*args, **kwargs)
-        self._archive = self.open_archive()
+        with profile('open_archive', self):
+            self._archive = self.open_archive()
 
     def __del__(self):
-        self.close_archive()
+        with profile('close_archive', self):
+            self.close_archive()
 
     @property
     def archive(self):

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


More information about the diffoscope mailing list