-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Glob.resolveGlob() is veeeery sloooow #5501
Comments
This is a known issue that #5157 tries to address. It manifests when wildcards used in the Changes in this area caused some slight differences in the set of linted files in the past which led to other issues. We should be really sure that a changed algorithm still produces the same matches. As pointed out in a comment, real world testing is difficult for us. So if you'd like to support, please try with #5157 if the performance issue is fixed, but the output is unchanged at the same time. Off topic: Instead of your custom rule |
Thank You for your answer. I will try and report back. |
Short answer: it doesn't seem so. Give me a bit of time for a deeper analysis. |
I just realized there is a line |
Thanks for playing around with the fix!
Yes, it's not part of the fix but should be taken into account at a later step when the rule runs. So if that doesn't work, there might be another issue.
I could reproduce that in a unit test. The thing here is that the last component could match files in the previous folder(s) or all folders (and their contained files) named |
New Issue Checklist
Describe the bug
A clear and concise description of what the bug is.
swiftlint became very slow in the last release. As if someone implemented a O(n^2) in Glob.resolveGlob(). In our project we are from several seconds (a dozen or so) to around of half an hour.
Complete output when running SwiftLint, including the stack trace and command used
Environment
SwiftLint version (run
swiftlint version
to be sure)?% swiftlint version
0.53.0
Installation method used (Homebrew, CocoaPods, building from source, etc)?
Homebrew
Paste your configuration file:
If so, paste their relative paths and respective contents.
xcodebuild -version
)?Xcode 15.2
Build version 15C500b
echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
to quickly test if your example is really demonstrating the issue. If your example is more
complex, you can use
swiftlint lint --path [file here] --no-cache --enable-all-rules
.See Instruments image
The text was updated successfully, but these errors were encountered: