Repository navigation
Replies: 2 comments 2 replies
|
Thanks, your analysis is right. File arguments only filter the results after full git discovery, so naming two files still costs as much as scanning the whole repo. We'll go with option 1: when every argument is an existing file (no globs or directories), skip git discovery and check those files directly, with A PR is welcome if you'd like to take it. Otherwise we'll pick it up. Side note: the subdirectory workaround works only because we don't search parent directories for |
|
I opened apache/skywalking-eyes#297 for this. Inside a Git repository, paths that name existing files, like the ones pre-commit passes, are now checked directly. Git discovery only runs for the remaining paths, such as globs and directories. In apache/skywalking, checking 5 files went from about 3.9s to 0.06s. To get the fast path, pass plain relative paths with Feel free to try the branch on your repo and let us know how it goes. |
Uh oh!
There was an error while loading. Please reload this page.
Hi!
apache/skywalking-eyes#263 introduced the ability to filter paths after git file discovery. However, on large repos, the git discovery still incurs noticeable cost (~1s, even when running license-eye itself is only ~50ms). This overhead only shows up when running the cli from a git repo root, and the difference is easy to check:
In the current listFiles() implementation, the Git branch:
This appears to explain why providing a short filename list does not avoid the repository-discovery cost.
Could explicit file arguments use direct filesystem discovery, or could an optional --no-git / configuration setting select the existing filesystem-discovery path? This would help avoid consequential overhead when using the cli through pre-commit hooks run on modified files.
All reactions