perf: cache mtime of scripts and notebooks#2965
perf: cache mtime of scripts and notebooks#2965johanneskoester merged 3 commits intosnakemake:mainfrom
Conversation
|
Warning Rate limit exceeded@johanneskoester has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 55 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe recent updates to the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
|
Very good catch! |
There was a problem hiding this comment.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (1)
- snakemake/jobs.py (3 hunks)
Additional context used
Path-based instructions (1)
snakemake/jobs.py (1)
Pattern
**/*.py: Do not suggest to add trailing commas.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Ruff
snakemake/jobs.py
92-92: Missing return type annotation for public function
get_script_mtime(ANN201)
92-92: Missing type annotation for function argument
path(ANN001)
Additional comments not posted (1)
snakemake/jobs.py (1)
406-409: Efficient use ofget_script_mtime.The use of
get_script_mtimeimproves the efficiency of the function by caching the script modification times, reducing redundant filesystem checks.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
🤖 I have created a release *beep* *boop* --- ## [8.18.0](v8.17.0...v8.18.0) (2024-08-14) ### Features * show info on missing metadata ([#3014](#3014)) ([e502312](e502312)) ### Performance Improvements * cache mtime of scripts and notebooks ([#2965](#2965)) ([405a056](405a056)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced detailed reporting for missing metadata during workflow execution, enhancing visibility and debugging. - **Performance Improvements** - Implemented caching for script and notebook modification times, improving workflow execution efficiency. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>



mtimeofscriptornotebookis checked repeatedly when the same rule is wildcard-expanded, causing a lot ofos.lstatcalls repeated on the same file, which is unnecessary and can be slow on some filesystems.This PR adds script mtime caching using
functools.lru_cache. It can speedup DAG building time.Related issues: #2920, #2949
QC
docs/) is updated to reflect the changes or this is not necessary (e.g. if the change does neither modify the language nor the behavior or functionalities of Snakemake).Summary by CodeRabbit
New Features
Improvements