Skip to content

Ava slows when there are many non-run files #1288

@taylor1791

Description

@taylor1791

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.

user@computer:~/src/ava-slow-test% ./benchmark.sh
Running tests...

  1 passed


real	0m7.377s
user	0m6.863s
sys	0m1.379s
Removing lib and re-running tests...

  1 passed


real	0m0.737s
user	0m0.589s
sys	0m0.100s
Resetting lib...

Environment

user@computer:~/src/ava-slow-test% node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' ' + os.release())"
Node.js v7.4.0
darwin 16.4.0
user@computer:~/src/ava-slow-test% ./node_modules/.bin/ava --version
0.18.2
user@computer:~/src/ava-slow-test% npm --version
4.0.5

Links

Test Repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcurrent functionality does not work as desiredscope:globbing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions