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

perf(ngcc): cache parsed tsconfig between runs #37417

Closed

Conversation

petebacondarwin
Copy link
Member

@petebacondarwin petebacondarwin commented Jun 3, 2020

This commit will store a cached copy of the parsed tsconfig
that can be reused if the tsconfig path is the same.

This will improve the ngcc "noop" case, where there is no processing
to do, when the entry-points have already been processed.
Previously we were parsing this config every time we checked for
entry-points to process, which can take up to seconds in some
cases.

Resolves #36882

In tests using the reproduction in the original this saves 8 secs per build.
In that issue the original project was suffering from 1.1s * 324 modules = 6 minutes delay.
This should be cut significantly to a few seconds.

This commit will store a cached copy of the parsed tsconfig
that can be reused if the tsconfig path is the same.

This will improve the ngcc "noop" case, where there is no processing
to do, when the entry-points have already been processed.
Previously we were parsing this config every time we checked for
entry-points to process, which can take up to seconds in some
cases.

Resolves angular#36882
@pullapprove pullapprove bot requested a review from alxhub June 3, 2020 17:08
@petebacondarwin petebacondarwin added comp: ngcc area: performance action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Jun 3, 2020
@ngbot ngbot bot modified the milestone: needsTriage Jun 3, 2020
packages/compiler-cli/ngcc/src/ngcc_options.ts Outdated Show resolved Hide resolved
packages/compiler-cli/ngcc/src/ngcc_options.ts Outdated Show resolved Hide resolved
@petebacondarwin petebacondarwin added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jun 4, 2020
@ngbot
Copy link

ngbot bot commented Jun 4, 2020

I see that you just added the PR action: merge label, but the following checks are still failing:
    failure status "pullapprove" is failing
    pending 2 pending code reviews

If you want your PR to be merged, it has to pass all the CI checks.

If you can't get the PR to a green state due to flakes or broken master, please try rebasing to master and/or restarting the CI job. If that fails and you believe that the issue is not due to your change, please contact the caretaker and ask for help.

Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

LGTM 👍

packages/compiler-cli/ngcc/test/ngcc_options_spec.ts Outdated Show resolved Hide resolved
atscott pushed a commit that referenced this pull request Jun 4, 2020
This commit will store a cached copy of the parsed tsconfig
that can be reused if the tsconfig path is the same.

This will improve the ngcc "noop" case, where there is no processing
to do, when the entry-points have already been processed.
Previously we were parsing this config every time we checked for
entry-points to process, which can take up to seconds in some
cases.

Resolves #36882

PR Close #37417
@atscott atscott closed this in 6e7bd93 Jun 4, 2020
@petebacondarwin petebacondarwin deleted the ngcc-cache-tsconfig branch June 4, 2020 18:40
petebacondarwin added a commit to petebacondarwin/angular that referenced this pull request Jun 8, 2020
This commit will store a cached copy of the parsed tsconfig
that can be reused if the tsconfig path is the same.

This will improve the ngcc "noop" case, where there is no processing
to do, when the entry-points have already been processed.
Previously we were parsing this config every time we checked for
entry-points to process, which can take up to seconds in some
cases.

Cherry-picked from angular#37417 (6e7bd93).

Resolves angular#36882
petebacondarwin added a commit to petebacondarwin/angular that referenced this pull request Jun 8, 2020
This commit will store a cached copy of the parsed tsconfig
that can be reused if the tsconfig path is the same.

This will improve the ngcc "noop" case, where there is no processing
to do, when the entry-points have already been processed.
Previously we were parsing this config every time we checked for
entry-points to process, which can take up to seconds in some
cases.

Cherry-picked from angular#37417 (6e7bd93).

Resolves angular#36882
ngwattcos pushed a commit to ngwattcos/angular that referenced this pull request Jun 25, 2020
This commit will store a cached copy of the parsed tsconfig
that can be reused if the tsconfig path is the same.

This will improve the ngcc "noop" case, where there is no processing
to do, when the entry-points have already been processed.
Previously we were parsing this config every time we checked for
entry-points to process, which can take up to seconds in some
cases.

Resolves angular#36882

PR Close angular#37417
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 5, 2020
profanis pushed a commit to profanis/angular that referenced this pull request Sep 5, 2020
This commit will store a cached copy of the parsed tsconfig
that can be reused if the tsconfig path is the same.

This will improve the ngcc "noop" case, where there is no processing
to do, when the entry-points have already been processed.
Previously we were parsing this config every time we checked for
entry-points to process, which can take up to seconds in some
cases.

Resolves angular#36882

PR Close angular#37417
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: performance cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ngcc: do not parse tsconfig.json more than once
4 participants