-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Hidden directories search performance decreased #1734
Comments
If I add this to
Please let me know if you need more data to get to the root cause of this. |
You say you get the performance decrease without a custom .rubocop.yml file. Do you get any deprecation warnings (“Warning: Deprecated pattern style …”)? |
No, none whatsoever. I'll post a copy&pasteable example to reproduce this tomorrow; should have done so earlier. |
I’ve been able to reproduce the issue by, as you said, bundling to I don’t quite see the same increase in runtime as you do, but that depends a lot on the number of hidden files and directories, I guess. The root of the problem is that two different styles of directory patterns are supported for the |
Here's a copy & paste example:
Output for the first rubocop run (gems in
Output for the second rubocop (gems in
Of course this increases dramatically for multiple Ruby versions, a larger number of Gems, a couple of |
@sometimesfood It's the other way around, right? Hidden directories are slower than excluded directories. At least that's what I get. @bquorning I think it's time to remove support for the old pattern style, but it won't solve the whole problem. There are some optimizations we could do to speed up the (non-)matching of hidden directories. I'll submit a PR soon so we can discuss whether the added code is justified. |
That's correct. Sorry, did not see @bquorning's earlier comment. |
Please take a look at the following The interesting thing is that removing the old style pattern matching gives no addition decrease in execution time when the other two optimizations have been applied. These are the results I got on my system. YMMV.
This is why I didn't make a pull request, because my suggestion is that we keep the old style pattern matching for now, as it's not relevant for this issue. |
Those numbers sure look good. Great job @jonas054. And my argument for removing the old pattern style doesn't apply anymore. I'm curious to see 2 more numbers:
|
@jonas054 Thanks, your changes to Hidden directories (
Excluded directories (
As you said, fd3c56e3 does not seem to have any measurable influence on performance. @bquorning Directly comparing performance with 0.29.1 is not possible because #1656 caused hidden directories to always be searched. With 0.29.1, I experienced runtime in excess of 90s. The last version that worked correctly for me before that was 0.28. While 0.28 did not have #1656, it was a lot slower than the current version for me:
All in all I think the changes are a big improvement. 👍 |
While commit 5df9ffb seems to have fixed #1656, it seems to have introduced a significant drop in performance.
I am using rubocop commit a1865b5 without a custom
.rubocop.yml
.With
bundle install --path vendor
:If I install my gems to
.bundle
(bundle install --path .bundle
), performance decreases sharply:Sorry to keep bothering you about this, but as rubocop is becoming increasingly popular and many developers are relying on it, I feel that this could affect other projects as well. (My project has a relatively small number of dependencies – for a typical Rails project the effect of this change would probably be even more pronounced.)
The text was updated successfully, but these errors were encountered: