Acknowledgement
Comment
🔎 Search Terms
project service cleanupProjectsAndScriptInfos openClientFileWithNormalizedPath openClientFile
🙁 Actual behavior
TypeScript project services open a file with service.openClientFile(filePathAbsolute, ...). That internally calls to a cleanupProjectsAndScriptInfos to clean up projects, such as removing orphans. There's no way to skip that cleanup.
When using typescript-eslint's parserOptions.projectService, that cleanup adds (seemingly?) unnecessary overhead per file being linted.
🙂 Expected behavior
When I tried commenting out its contents of cleanupProjectsAndScriptInfos locally, the time for a lint run of ~1024 files with the project service speed up by ~15-20%, from ~3.2 seconds to ~2.5 seconds. ⚡
Request: could we add an option to the ProjectService class to skip cleanups, please?
Alternate request: failing that, maybe the cleanups can be debounced and/or delayed in some way? E.g. added to a queue that only executes if the project service is still active?
Additional information about the issue
On the TypeScript side:
On the typescript-eslint side:
cc @sheetalkamat as FYI, after a pairing with @jakebailey.
@jakebailey suggested I also include a screenshot like this speedscope.app view of an ESLint CLI run with parserOptions.projectService:

Acknowledgement
Comment
🔎 Search Terms
project service cleanupProjectsAndScriptInfos openClientFileWithNormalizedPath openClientFile
🙁 Actual behavior
TypeScript project services open a file with
service.openClientFile(filePathAbsolute, ...). That internally calls to acleanupProjectsAndScriptInfosto clean up projects, such as removing orphans. There's no way to skip that cleanup.When using typescript-eslint's
parserOptions.projectService, that cleanup adds (seemingly?) unnecessary overhead per file being linted.🙂 Expected behavior
When I tried commenting out its contents of
cleanupProjectsAndScriptInfoslocally, the time for a lint run of ~1024 files with the project service speed up by ~15-20%, from ~3.2 seconds to ~2.5 seconds. ⚡Request: could we add an option to the
ProjectServiceclass to skip cleanups, please?Alternate request: failing that, maybe the cleanups can be debounced and/or delayed in some way? E.g. added to a queue that only executes if the project service is still active?
Additional information about the issue
On the TypeScript side:
cleanupProjectsAndScriptInfos.On the typescript-eslint side:
cc @sheetalkamat as FYI, after a pairing with @jakebailey.
@jakebailey suggested I also include a screenshot like this speedscope.app view of an ESLint CLI run with
parserOptions.projectService: