提交 41a80f54 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Added debug timing info about cache

上级 afca8297
...@@ -372,6 +372,7 @@ class ModuleCache(object): ...@@ -372,6 +372,7 @@ class ModuleCache(object):
self.refresh() self.refresh()
start = time.time()
if check_for_broken_eq: if check_for_broken_eq:
for k0 in self.entry_from_key: for k0 in self.entry_from_key:
for k1 in self.entry_from_key: for k1 in self.entry_from_key:
...@@ -386,6 +387,7 @@ class ModuleCache(object): ...@@ -386,6 +387,7 @@ class ModuleCache(object):
warning("Key 1:", k1) warning("Key 1:", k1)
warning("Entry 1:", self.entry_from_key[k1]) warning("Entry 1:", self.entry_from_key[k1])
warning("hash 1:", hash(k1)) warning("hash 1:", hash(k1))
debug('Time needed to check broken equality / hash: %s' % (time.time() - start))
age_thresh_use = 60*60*24*24 age_thresh_use = 60*60*24*24
""" """
...@@ -403,6 +405,7 @@ class ModuleCache(object): ...@@ -403,6 +405,7 @@ class ModuleCache(object):
Also, remove malformed cache directories. Also, remove malformed cache directories.
""" """
start_time = time.time()
too_old_to_use = [] too_old_to_use = []
compilelock.get_lock() compilelock.get_lock()
...@@ -571,6 +574,8 @@ class ModuleCache(object): ...@@ -571,6 +574,8 @@ class ModuleCache(object):
finally: finally:
compilelock.release_lock() compilelock.release_lock()
debug('Time needed to refresh cache: %s' % (time.time() - start_time))
return too_old_to_use return too_old_to_use
def module_from_key(self, key, fn=None, keep_lock=False): def module_from_key(self, key, fn=None, keep_lock=False):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论