forked from bazel-contrib/rules_nodejs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not attempt to evict currently compiling files from cache.
TypeScript's compiler holds hard references to source files for the entire duration of a compilation. These files cannot be garbage collected, so evicting them from the current cache does not actually free memory. This caused particularly bad caching behaviour where if the sources for one compilation unit were larger than the cache, tsc_wrapped would empty out its entire cache trying to free up memory with no effect, rendering the cache ineffectual. Instead, this change pins source files that are part of the current compilation unit (as tracked by the list of current digests). This also undoes the generalisation of FileCache. Apparently its reuse in the linter never materialized. Given the specific knowledge about file digests, this also seems unlikely in the future. While at it, this also fixes some warnings across the files, uses an ES6 Map for the digests, and improves performance of the strict deps test by caching lib.d.ts ASTs. PiperOrigin-RevId: 205792937
- Loading branch information
Showing
10 changed files
with
197 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.