-
Notifications
You must be signed in to change notification settings - Fork 25.8k
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
perf(compiler-cli): minimize filesystem calls when generating shims #47682
Conversation
Previously when a file was being analyzed to determine if a shim should be generated, up to two calls to the host `fileExists` function per file per generator were made. In the default host, each `fileExists` call made two underlying file system calls. Following these calls, the file was then read via `getSourceFile`. However, `getSourceFile` will return `undefined` if the requested file does not exist. As a result, `getSourceFile` can be used directly to request both potential file names and leverage the return value to determine if the file does not exist. This avoids the need to call `fileExists` at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I think this can go into patch instead of minor, can't it?
This PR was merged into the repository by commit a792bf1. |
…47682) Previously when a file was being analyzed to determine if a shim should be generated, up to two calls to the host `fileExists` function per file per generator were made. In the default host, each `fileExists` call made two underlying file system calls. Following these calls, the file was then read via `getSourceFile`. However, `getSourceFile` will return `undefined` if the requested file does not exist. As a result, `getSourceFile` can be used directly to request both potential file names and leverage the return value to determine if the file does not exist. This avoids the need to call `fileExists` at all. PR Close #47682
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@angular/animations](https://github.com/angular/angular) | dependencies | patch | [`14.2.5` -> `14.2.6`](https://renovatebot.com/diffs/npm/@angular%2fanimations/14.2.5/14.2.6) | | [@angular/common](https://github.com/angular/angular) | dependencies | patch | [`14.2.5` -> `14.2.6`](https://renovatebot.com/diffs/npm/@angular%2fcommon/14.2.5/14.2.6) | | [@angular/compiler](https://github.com/angular/angular) | dependencies | patch | [`14.2.5` -> `14.2.6`](https://renovatebot.com/diffs/npm/@angular%2fcompiler/14.2.5/14.2.6) | | [@angular/compiler-cli](https://github.com/angular/angular/tree/main/packages/compiler-cli) ([source](https://github.com/angular/angular)) | devDependencies | patch | [`14.2.5` -> `14.2.6`](https://renovatebot.com/diffs/npm/@angular%2fcompiler-cli/14.2.5/14.2.6) | | [@angular/core](https://github.com/angular/angular) | dependencies | patch | [`14.2.5` -> `14.2.6`](https://renovatebot.com/diffs/npm/@angular%2fcore/14.2.5/14.2.6) | | [@angular/forms](https://github.com/angular/angular) | dependencies | patch | [`14.2.5` -> `14.2.6`](https://renovatebot.com/diffs/npm/@angular%2fforms/14.2.5/14.2.6) | | [@angular/platform-browser](https://github.com/angular/angular) | dependencies | patch | [`14.2.5` -> `14.2.6`](https://renovatebot.com/diffs/npm/@angular%2fplatform-browser/14.2.5/14.2.6) | | [@angular/platform-browser-dynamic](https://github.com/angular/angular) | dependencies | patch | [`14.2.5` -> `14.2.6`](https://renovatebot.com/diffs/npm/@angular%2fplatform-browser-dynamic/14.2.5/14.2.6) | --- ### Release Notes <details> <summary>angular/angular</summary> ### [`v14.2.6`](https://github.com/angular/angular/blob/HEAD/CHANGELOG.md#​1426-2022-10-12) [Compare Source](angular/angular@14.2.5...14.2.6) ##### compiler-cli | Commit | Type | Description | | -- | -- | -- | | [3fd176a905](angular/angular@3fd176a) | fix | add missing period to error message ([#​47744](angular/angular#47744)) | | [c3821f5ab5](angular/angular@c3821f5) | perf | minimize filesystem calls when generating shims ([#​47682](angular/angular#47682)) | #### Special Thanks Alan Agius, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bob Watson, Charles Lyding, Joey Perrott, Joshua Morony, Mathew Berg, Paul Gschwendtner, Peter Dickten, Renan Ferro, Sri Ram, WD Snoeijer, markostanimirovic and Álvaro Martínez <!-- CHANGELOG SPLIT MARKER --> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMzQuMiIsInVwZGF0ZWRJblZlciI6IjMyLjIzNi4xIn0=--> Co-authored-by: cabr2-bot <[email protected]> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1582 Reviewed-by: Epsilon_02 <[email protected]> Co-authored-by: Calciumdibromid Bot <[email protected]> Co-committed-by: Calciumdibromid Bot <[email protected]>
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Previously when a file was being analyzed to determine if a shim should be generated, up to two calls to the host
fileExists
function per file per generator were made. In the default host, eachfileExists
call made two underlying file system calls. Following these calls, the file was then read viagetSourceFile
. However,getSourceFile
will returnundefined
if the requested file does not exist. As a result,getSourceFile
can be used directly to request both potential file names and leverage the return value to determine if the file does not exist. This avoids the need to callfileExists
at all.