Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: avoid superflous mtime checks when the same file is referred to by multiple jobs #2284

Merged
merged 2 commits into from Jun 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions snakemake/io.py
Expand Up @@ -145,12 +145,15 @@ async def worker(queue):
if item is stop_item:
queue.task_done()
return
try:
self.mtime[item] = await self.collect_mtime(item)
except Exception as e:
queue.task_done()
# Avoid superfluously checking mtime as the same file might be
# added multiple times to the queue.
if item not in self.mtime:
try:
self.mtime[item] = await self.collect_mtime(item)
except Exception as e:
queue.task_done()

raise e
raise e
queue.task_done()

tasks = [
Expand Down