René's URL Explorer Experiment


Title: NgccProcessor slowing down subsequent builds with AngularCompilerPlugin · Issue #15078 · angular/angular-cli · GitHub

Open Graph Title: NgccProcessor slowing down subsequent builds with AngularCompilerPlugin · Issue #15078 · angular/angular-cli

X Title: NgccProcessor slowing down subsequent builds with AngularCompilerPlugin · Issue #15078 · angular/angular-cli

Description: I'm using the AngularCompilerPlugin for a medium-sized project and I've observed a slowdown in build times after enabling Ivy which appears to come from ngcc. When Ivy is enabled the AngularCompilerPlugin runs the NgccProcessor which is ...

Open Graph Description: I'm using the AngularCompilerPlugin for a medium-sized project and I've observed a slowdown in build times after enabling Ivy which appears to come from ngcc. When Ivy is enabled the AngularCompile...

X Description: I'm using the AngularCompilerPlugin for a medium-sized project and I've observed a slowdown in build times after enabling Ivy which appears to come from ngcc. When Ivy is enabled the Angula...

Opengraph URL: https://github.com/angular/angular-cli/issues/15078

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"NgccProcessor slowing down subsequent builds with AngularCompilerPlugin","articleBody":"I'm using the `AngularCompilerPlugin` for a medium-sized project and I've observed a slowdown in build times after enabling Ivy which appears to come from `ngcc`. When Ivy is enabled the `AngularCompilerPlugin` runs the `NgccProcessor` which is supposed to compile the `node_modules` for Ivy on the first run, however in my case any subsequent builds are slowed down as well.\r\n\r\nI have a hacky way to disable the `NgccProcessor` which I've used to measure the differences in build times. Here's what it looks like:\r\n\r\n```ts\r\nclass MyAngularCompilerPlugin extends AngularCompilerPlugin {\r\n    public apply(compiler: Compiler): void {\r\n        super.apply(compiler);\r\n        \r\n        compiler.hooks.environment.tap('angular-compiler', () => {\r\n            (this as any)._compilerHost.ngccProcessor = undefined;\r\n        });\r\n    }\r\n}\r\n```\r\n\r\nHere are the timings for 5 production builds on my own machine. Note that these times **are after `ngcc` has been run once** over the `node_modules` in a `postinstall` script. \r\n\r\n```\r\n// Without ngcc (80737ms on average)\r\n84520ms\r\n72547ms\r\n81733ms\r\n85043ms\r\n79844ms\r\n------------------------\r\n// With ngcc (94208ms on average)\r\n93741ms\r\n93714ms\r\n92922ms\r\n97220ms\r\n93444ms\r\n```\r\n\r\nThe 15s slower build time for a production build isn't a big deal locally, however the difference becomes even larger when running it on our CI server. For our production builds we need to run about 30 Webpack builds (10 at a time in parallel), about 20 which go through the `AngularCompilerPlugin`. Disabling the `NgccProcessor` on our CI server reduced our build time from around **10 minutes to about 6 minutes**. Furthermore keeping the `NgccProcessor` led to some flakiness in our builds, presumably because 10 different `ngcc` processes were trying to access file at the same time. Our build script looks something like this:\r\n\r\n1. Run `npm ci`.\r\n2. Run `ngcc` programmatically as follows:\r\n```ts\r\nconst ngcc = require('@angular/compiler-cli/ngcc');\r\nngcc.process({\r\n    basePath: path.join(projectRoot, 'node_modules'),\r\n    compileAllFormats: false,\r\n    propertiesToConsider: ['browser', 'module', 'main'],\r\n    createNewEntryPointFormats: true\r\n});\r\n```\r\n3. Run `webpack --mode=production` 30 times by splitting them into chunks of 10 that are run concurrently. We have some logic that tries to make sure that we always run the maximum number of builds, but it stays the same no matter whether `ngcc` is enabled so it shouldn't have an effect on the times.\r\n\r\nI can see a couple of ways to get around this:\r\n\r\n1. Short term: add an option to the `AngularCompilerPlugin` config that allows users that know what they're doing to disable the `NgccProcessor`.\r\n2. Long term: rework either `ngcc` or `NgccProcessor` so that it doesn't have to spend time analyzing the `node_modules` after it has been run already.\r\n\r\ncc @filipesilva \r\n","author":{"url":"https://github.com/crisbeto","@type":"Person","name":"crisbeto"},"datePublished":"2019-07-15T08:10:30Z","url":"https://github.com/angular/angular-cli/issues/15078"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:bc4ad53a-3aa2-e4b6-7a11-d82a9d9e981d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD920:2E3FEE:10EDA39:157AA69:6B011644
html-safe-nonce4c7764f3cd53bc0028e3e25c9e4f2a626a9ed989c3654c733a575f15c4c08b5b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTIwOjJFM0ZFRToxMEVEQTM5OjE1N0FBNjk6NkIwMTE2NDQiLCJ2aXNpdG9yX2lkIjoiNTQzMjI1OTgyNDQzMzgyOTQ0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac348f90f78826ea5629aedc3bfa53d74e5c57c58140d6d6e7094fe2ed54fb9e31
hovercard-subject-tagissue:467993358
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/15078/issue_layout
twitter:imagehttps://opengraph.githubassets.com/980272b5c85ee0a0700322e740458f67a831e7b645df3b87c45d25e375769253/angular/angular-cli/issues/15078
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/980272b5c85ee0a0700322e740458f67a831e7b645df3b87c45d25e375769253/angular/angular-cli/issues/15078
og:image:altI'm using the AngularCompilerPlugin for a medium-sized project and I've observed a slowdown in build times after enabling Ivy which appears to come from ngcc. When Ivy is enabled the AngularCompile...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamecrisbeto
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/angular/angular-cli git https://github.com/angular/angular-cli.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id36891867
octolytics-dimension-repository_nwoangular/angular-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id36891867
octolytics-dimension-repository_network_root_nwoangular/angular-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular-cli/issues/15078#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F15078
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fissues%2F15078
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/issues/15078
Reloadhttps://github.com/angular/angular-cli/issues/15078
Reloadhttps://github.com/angular/angular-cli/issues/15078
angularhttps://github.com/angular
angular-clihttps://github.com/angular/angular-cli
Codehttps://github.com/angular/angular-cli
Issues198 (198)https://github.com/angular/angular-cli/issues
Pull requests23 (23)https://github.com/angular/angular-cli/pulls
Actionshttps://github.com/angular/angular-cli/actions
Security and quality8 (8)https://github.com/angular/angular-cli/security
Insightshttps://github.com/angular/angular-cli/insights
https://github.com/angular/angular-cli
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/15078
New issuehttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/15078
NgccProcessor slowing down subsequent builds with AngularCompilerPluginhttps://github.com/angular/angular-cli/issues/15078#top
area: @ngtools/webpackhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40ngtools%2Fwebpack%22
freq3: highhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq3%3A%20high%22
needs: more infoReporter must clarify the issuehttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22needs%3A%20more%20info%22
severity4: memory/performancehttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity4%3A%20memory%2Fperformance%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
Backloghttps://github.com/angular/angular-cli/milestone/12
https://github.com/crisbeto
crisbetohttps://github.com/crisbeto
on Jul 15, 2019https://github.com/angular/angular-cli/issues/15078#issue-467993358
@filipesilvahttps://github.com/filipesilva
Nexthttps://github.com/angular/angular-cli/issues/15078?timeline_page=1
https://github.com/alan-agius4
alan-agius4https://github.com/alan-agius4
on Jul 15, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-511351051
@crisbetohttps://github.com/crisbeto
@petebacondarwinhttps://github.com/petebacondarwin
alan-agius4https://github.com/alan-agius4
area: @ngtools/webpackhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40ngtools%2Fwebpack%22
severity4: memory/performancehttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity4%3A%20memory%2Fperformance%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22feature%22
on Jul 15, 2019https://github.com/angular/angular-cli/issues/15078#event-2482450930
ngbothttps://github.com/apps/ngbot
Backloghttps://github.com/angular/angular-cli/milestone/12
on Jul 15, 2019https://github.com/angular/angular-cli/issues/15078#event-2482450956
alan-agius4https://github.com/alan-agius4
severity3: brokenhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
severity4: memory/performancehttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity4%3A%20memory%2Fperformance%22
severity4: memory/performancehttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity4%3A%20memory%2Fperformance%22
featureLabel used to distinguish feature request from other issueshttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22feature%22
on Jul 15, 2019https://github.com/angular/angular-cli/issues/15078#event-2482451682
ngbothttps://github.com/apps/ngbot
Backloghttps://github.com/angular/angular-cli/milestone/12
needsTriagehttps://github.com/angular/angular-cli/milestone/11
on Jul 15, 2019https://github.com/angular/angular-cli/issues/15078#event-2482452459
alan-agius4https://github.com/alan-agius4
freq3: highhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq3%3A%20high%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
severity3: brokenhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity3%3A%20broken%22
on Jul 15, 2019https://github.com/angular/angular-cli/issues/15078#event-2482452592
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular-cli/milestone/11
on Jul 15, 2019https://github.com/angular/angular-cli/issues/15078#event-2482453086
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Jul 16, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-511718908
angular/angular#30593https://github.com/angular/angular/pull/30593
https://github.com/petebacondarwin
petebacondarwinhttps://github.com/petebacondarwin
on Jul 16, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-511723864
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Jul 16, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-511738282
angular/angular#30593https://github.com/angular/angular/pull/30593
https://github.com/alan-agius4
alan-agius4https://github.com/alan-agius4
on Jul 16, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-511990063
@crisbetohttps://github.com/crisbeto
alan-agius4https://github.com/alan-agius4
completedhttps://github.com/angular/angular-cli/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 16, 2019https://github.com/angular/angular-cli/issues/15078#event-2487512766
https://github.com/crisbeto
crisbetohttps://github.com/crisbeto
on Jul 19, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-513244841
@petebacondarwinhttps://github.com/petebacondarwin
@alan-agius4https://github.com/alan-agius4
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Jul 20, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-513456256
@crisbetohttps://github.com/crisbeto
https://github.com/crisbeto
crisbetohttps://github.com/crisbeto
on Jul 20, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-513456496
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Jul 20, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-513483455
https://github.com/crisbeto
crisbetohttps://github.com/crisbeto
on Jul 20, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-513485521
https://github.com/gkalpak
gkalpakhttps://github.com/gkalpak
on Jul 20, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-513491956
https://github.com/crisbeto
crisbetohttps://github.com/crisbeto
on Jul 20, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-513492254
https://github.com/petebacondarwin
petebacondarwinhttps://github.com/petebacondarwin
on Jul 21, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-513527195
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 9, 2019https://github.com/angular/angular-cli/issues/15078#issuecomment-529612652
automatic conversation locking policyhttps://github.com/angular/angular/blob/67d80f/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Sep 9, 2019https://github.com/angular/angular-cli/issues/15078#event-2619748158
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular-cli/issues/15078
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular-cli/issues/15078
area: @ngtools/webpackhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22area%3A%20%40ngtools%2Fwebpack%22
freq3: highhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22freq3%3A%20high%22
needs: more infoReporter must clarify the issuehttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22needs%3A%20more%20info%22
severity4: memory/performancehttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22severity4%3A%20memory%2Fperformance%22
type: bug/fixhttps://github.com/angular/angular-cli/issues?q=state%3Aopen%20label%3A%22type%3A%20bug%2Ffix%22
BacklogNo due datehttps://github.com/angular/angular-cli/milestone/12
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.