Skip to content
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

Add a file provider that avoids ts program walk #100

Merged

Conversation

Adjective-Object
Copy link
Collaborator

@Adjective-Object Adjective-Object commented Aug 11, 2021

Adds a faster file provider that discovers source and fence files with a
fast asyncronous file walk rather than by relying on typescript to
perform a syncronous walk + parse of the program.

We still use typescript to parse compilerOptions, but since we no longer
rely on the typescript program walk to identify files, we stub out file
discovery so only the initial config parse happens.

Also adds config options to support switching between the two providers,
since it will only work when all source files you intend to check fences
against fall under your rootDirs.
This is the case for OWA, but I don't know what other consumers look
like.

Depends on u/mahuangh/faster-source-providers-2

Quick (completely nonscientific) test for impact on performance:

$ time yarn good-fences --rootDir packages shared -p ./tsconfig.noprojects.json --progressBar -x
Done in 45.17s.

real    0m45.452s
user    0m0.000s
sys     0m0.152s

$ time yarn good-fences --rootDir packages shared -p ./tsconfig.noprojects.json --progressBar
Done in 359.96s.

real    6m0.237s
user    0m0.046s
sys     0m0.121s

Maxwell Huang-Hobbs added 2 commits August 11, 2021 16:52
Adds a faster file provider that discovers source and fence files with a
fast asyncronous file walk rather than by relying on typescript to
perform a syncronous walk + parse of the program.

We still use typescript to parse compilerOptions, but since we no longer
rely on the typescript program walk to identify files, we stub out file
discovery so only the initial config partse happens.

Also adds config options to support switching between the two providers,
since it will only work when all source files you intend to check fences
against fall under your rootDirs.
This is the case for OWA, but I don't know what other consumers look
like.

Depends on u/mahuangh/faster-source-providers-2
src/core/FdirSourceFileProvider.ts Outdated Show resolved Hide resolved
src/utils/getOptions.ts Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
Copy link
Owner

@smikula smikula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. I wish we didn't have to bend over backwards to get good perf relative to typescript, but the speed gains are impressive! I just left a handful of nitpick comments.

@smikula smikula merged commit 668999c into smikula:master Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants