-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Ava slows when there are many non-run files #1288
Comments
I just noticed that this may be related to #1228. |
AVA needs to find your tests. It uses globbing patterns, which by default are quite wide ( @avajs/core I think we can consider this a common pitfall, so we should at least document it. Perhaps we should log a warning if globbing takes X amount of time? |
I definitely think it should at least be a common pitfall. Thanks @taylor1791 for the detailed issue! |
With that guidance, I put in some For what it is worth, if there were some |
Wow, that's unexpectedly high.
Actually I think we need to optimize how we find helpers. The search starts here: Line 138 in bd5ed60
Line 123 in bd5ed60
Line 149 in bd5ed60
It strikes me that we already know where the test files are when we start looking for helpers. We can find I'm hesitant when it comes to making helper patterns configurable. I think we first need to get the default behavior right, lest the answer becomes "nah just change these patterns".
I think it's a bug actually, so I'm glad you reported it! 😄 |
@novemberborn still there isn't a way to exclude those large non-tests folders? |
@simonepri you can negate test file patterns, e.g. (Assuming the underlying globbing implementation behaves efficiently enough.) |
@novemberborn
But nothing changes. I'll try your suggestion 👍 but I think is pretty the same thing I've already done, am I wrong? |
|
Already tried also with files.
I think I've tried any possible configuration 😆 E.g: I think we should add some options to filter the paths before passing it to the matcher. |
That's what |
Description
I started a project a while ago and I noticed that
ava
slowed down over time. At the start it used to clock in at under a second. As I added more code and my configuration changed it is now around 15 seconds. This is an extremely long feedback cycle. Using--watch
does not appear to produce a significant improvement.I managed to reproduce the problem in a test repo. Further testing show it has to do with the number of files in the directory. It does not matter what type of files they are. In the example repo, I have a 1 simple test, a copy of node, and a benchmark script. When I remove the copy of node it is significantly faster. Here is a sample run of the script.
Environment
Links
Test Repository
The text was updated successfully, but these errors were encountered: