Skip to content

File globbing slow with large node_modules folder #332

Closed
@poelstra

Description

@poelstra

Atom Typescript adds the following filesGlob to tsconfig.json by default:

"./**/*.ts",
"!./node_modules/**/*.ts"

This indeed excludes things from node_modules, but it apparently still causes the full node_modules folder to be traversed.

I've tried replacing the second line with "./node_modules/**" and "./node_modules/" in order to prevent it from entering the directory at all, but that didn't seem to help (or didn't work at all).

We have a very large number of node modules in this particular tree, which makes Atom very slow for many operations (adding a file, renaming) and causes frequent hickups while editting. Haven't timed it exactly, but it's in the order of tens of seconds before e.g. a save of tsconfig.json 'notices' added or removed files.

As an experiment, I moved the tsconfig.json to the subdir that actually contains the TS code (which doesn't have a node_modules dir), and now saving tsconfig,json is 'just' a second or two (it's a fairly large codebase).

Somewhat related to #217, which also got slow due to traversing large number of directories.

Is there e.g. a different glob pattern that may help?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions