-
Notifications
You must be signed in to change notification settings - Fork 418
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
Credo runs really slowly on my project #84
Comments
This is a valid concern (and true: Credo is not fast, yet), but I haven't gotten around to address this (mostly due to time constraints). A couple of thoughts:
Please understand that this does not mean that I do not take speed seriously. I do, there is the plan to tackle it after 1.0 is out the door, and if anyone would like to look into this, I am very likely to merge those changes even before 1.0 - it's just that I have finite time for this project 😞 Any thoughts on this subject would be greatly appreciated! 👍 |
Is the slow nature of the Consistency checks due to the need to infer the established style in the project in existing code? I really like the consistency checks (in fact, it's one of the main reasons I'm trying credo: on our project we've been using a home-grown BTW, as someone who has maintained several open source projects, I completely understand the time crunch and choosing carefully what to focus on now :). |
Precisely. I'm sure there is some potential here, since my approach was a bit pragmatic.
Huh, I will have to think about that. The point is in some cases we could possibly use regexes instead of the elixir_tokenizer if Credo knows what you want. I just released |
I gave 0.4.0-beta3 a try and now I get a timeout:
|
I upped the timeout limit from 30 seconds to 10 minutes. |
I gave
If anything, that's slower :(. |
If it would solve this issue, I would wholeheartedly support changing the consistency checks to not infer and decide which form is correct but rather be explicitly told. "This project uses 2 spaces" The speed issues with credo are sadly piling up fast and it's almost entirely due to consistency checks. The worst part is, the consistency checks are some of the checks I want most. |
In our code base it's these two checks that give us 10x slowdown: Without these two it runs in 17s |
I tried credo 0.8.2 on phoenixframework, took 12 seconds compared to dogmas 3 seconds. I tried disabling checks with |
@myronmarston The recent release of 0.8.2 includes some significant optimizations to make those consistency checks run much faster. I'd be curious to see how that release works for you! |
I sadly don't have the time to try that right now. I'm leaving on a long vacation tomorrow and have some important things to get done first. I'm looking forward to trying it in the future, though! |
@devonestes I repeated my test from #84 (comment) with 0.8.1. Takes ~22 seconds compared to the ~12 seconds with 0.8.2. For the consistency checks only ( (As discussed above and reported in #404, the whole command still runs for the whole 12 and 22 seconds respectively). |
@jvf Nice!! Well, that other bug aside, I think this is some great progress! |
I'm running into this issue with 0.9.2, however, running with |
Confirmed what @jeremyowensboggs noticed.
Running on Mac. |
This issue has been open for almost 4 years now, with the last comment almost 2 years ago. Given the amount of improvements made since then, I would be interested to see where everyone stands with the latest as far as speed. I also would recommend we close this issue and if there are specific action items that remain that should be taken from it, individual issues be created for them so we can have actionable tasks to work on. |
@TheFirstAvenger Hi, would love to jump into this thread. We are also experiencing fairly slow credo times for our large umbrella application. Firstly, I would love a debug flag to credo to see the times of each individual check. This would significantly help track down which ones are slow for our application. Secondly, given the first one is available, I’d love to help track down and make improvements to the slower checks. I’d also be interested in contributing performance improvements, is there a getting started guide for contributors? Thanks! |
@mackeyja92 Could you try the current You can do this by setting the Credo dep to {:credo, github: "rrrene/credo"} Please report back if this improves your Credo experience! 👍 |
@rrrene We are currently locked to 1.0 from hex. Here is the results of my run using Results: However, we have had such issues running it from the root we typically run it more like this. These numbers vary from run to run, typically master is faster but not by a significant margin. |
@mackeyja92 Mmmh, this is surprising. I had hoped for a better speed-up. To test this with a large umbrella, I created an umbrella from these 10 repos consisting of 1,500 Elixir files containing 226,000 lines of Elixir code. I executed the (unscientific) test runs on an Ubuntu 19.10 VM with 8 CPUs and 24 GB RAM. This VM was not tailored to this test, it was just around 😉 Analysed Codebase
Credo v1.0.5Analysis took 1018.0 seconds (0.7s to load, 1017.3s running checks) Credo v1.4.0Analysis took 441.6 seconds (1.3s to load, 440.3s running 54 checks on 1234 files) Credo v1.5.0-dev (master)Analysis took 144.3 seconds (1.1s to load, 143.2s running 55 checks on 1234 files) One thing that is strange to me is that your codebase does not see any speed increase worth mentioning. Could you paste the summary of one of the runs? ("summary" being the snippets I posted above containing the times, file count, etc.) |
With the DuplicatedCode check enabled we weren't seeing any differences in speed between 1.4.0 and the master branch. We saw a large reduction in run time by disabling the duplicate code check. We're seeing significant decreases when using the newer branch with the DuplicatedCode check disabled. 1.4.01.4.0: 1.4.0: 1.4.0: rrrene/credo mastergit master: git master: git master: |
Yeah I was upgrading from 0.10.0 yesterday, and we had that enabled in our old config. It's not critical, and I disabled it after regenerating the config and re-applying our customizations. With that said, your latest changes seemed to speed it up a lot. 👍 Both using: DuplicatedCode Disabled
DuplicatedCode Enabled (Previously 91.9 seconds)
|
I believe this is no longer an issue with the newest version. Thanks to anyone who contributed datapoints, insights and pull requests to speed up Credo! 🎉 If I am mistaken, please feel free to open another issue! |
We've got a pretty large umbrella project (with 41 sub-apps), and I'm considering adding credo to the project and using a particular strict configuration (for the rules we care most about) as part of our travis CI build process. However, it's running reaaaaally slow:
That's nearly 7 minutes. Our Travis build currently has a few matrix entries that each run in the 2-4 minute range, so I'm not too keen to add another entry that takes 7 minutes as it'll effectively double our build times.
Is there a way to configure things to speed credo up? Or are there plans to improve its perf?
I already tried decreasing the number of enabled checks (commenting out most of them from my
.credo.exs
file) but that didn't appear to help.The text was updated successfully, but these errors were encountered: