René's URL Explorer Experiment


Title: perf(@angular/build): read rendered module length once per module in chunk optimizer by roman-garcia · Pull Request #34045 · angular/angular-cli · GitHub

Open Graph Title: perf(@angular/build): read rendered module length once per module in chunk optimizer by roman-garcia · Pull Request #34045 · angular/angular-cli

X Title: perf(@angular/build): read rendered module length once per module in chunk optimizer by roman-garcia · Pull Request #34045 · angular/angular-cli

Description: PR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-commit-message-guidelines Tests for the changes have been added (for bug fixes / features) Docs have been added / updated (for bug fixes / features) No test added: the change is a pure performance fix with no behavioral difference. The generated metafile is byte-identical before and after (verified by replaying optimizeChunks on a dumped esbuild result and comparing the serialized metafile and initialFiles). Happy to add a spec if you can point me at a suitable harness for chunk-optimizer. PR Type What kind of change does this PR introduce? Bugfix Feature Code style update (formatting, local variables) Refactoring (no functional changes, no api changes) Build related changes CI related changes Documentation content changes Other... Please describe: performance What is the current behavior? Issue Number: #34044 In bundleOutputToEsbuildMetafile, renderedModule.renderedLength is read inside the loop over each module's original inputs. On rolldown's rendered module object that property is a lazy getter (bindingRenderedModule.code?.length) which transfers the entire module code from native memory on every access. Because each "module" in the chunk optimizer is a whole esbuild output chunk, a 17 MB main chunk with 3,588 inputs performs 3,588 copies of a 17 MB string (~62 GB). On the application in the linked issue this is ~157 s out of a ~161 s OPTIMIZE_CHUNKS phase, while the rolldown bundling itself takes ~3 s. Rolldown also emits a misleading [PLUGIN_TIMINGS] warning about the angular-bundle plugin as a side effect. What is the new behavior? The rendered length is read once per module before iterating its inputs. Measured on the same application and machine (production configuration, sourceMap: true): Before After DURATION[OPTIMIZE_CHUNKS] 179 s 4 s Total ng build 234 s 55 s Output files are byte-identical (same file list, same SHA-256 for every JS and CSS file). Does this PR introduce a breaking change? Yes No Other information A follow-up on the rolldown side could cache code in transformToRenderedModule, but this hoist removes the cost regardless of the rolldown version. The [PLUGIN_TIMINGS] warning still fires after the fix because rolldown compares plugin time against a near-zero link stage when the inputs are a few hundred pre-bundled chunks; passing checks: { pluginTimings: false } to rolldown() in the optimizer would silence it, but that is left out of this PR. 🤖 Generated with Claude Code

Open Graph Description: PR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-comm...

X Description: PR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-comm...

Opengraph URL: https://github.com/angular/angular-cli/pull/34045

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:88f060e4-3680-7b1a-82e8-4e635a2d95aa
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBE58:4279A:107E157:1631C32:6B011E57
html-safe-nonce73838dbfd58e8f9638833630271f75b79b8ed5e9e8f4958fc3b6dd6ef483d2c3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTU4OjQyNzlBOjEwN0UxNTc6MTYzMUMzMjo2QjAxMUU1NyIsInZpc2l0b3JfaWQiOiI3NjIxMjg1MTUyMDM0OTg3NjA3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac38b4e05273b54211fc98e4bc35cd82cf7f20cef2cf9335e3134f97d9f1eada41
hovercard-subject-tagpull_request:4475113080
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/angular/angular-cli/pull/34045/files
twitter:imagehttps://avatars.githubusercontent.com/u/19957832?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/19957832?s=400&v=4
og:image:altPR Checklist Please check to confirm your PR fulfills the following requirements: The commit message follows our guidelines: https://github.com/angular/angular-cli/blob/main/CONTRIBUTING.md#-comm...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
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-turbotrue
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

Links:

Skip to contenthttps://github.com/angular/angular-cli/pull/34045/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular-cli%2Fpull%2F34045%2Ffiles
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%2Fpull%2F34045%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=angular%2Fangular-cli
Reloadhttps://github.com/angular/angular-cli/pull/34045/files
Reloadhttps://github.com/angular/angular-cli/pull/34045/files
Reloadhttps://github.com/angular/angular-cli/pull/34045/files
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
Sign up for GitHub https://github.com/signup?return_to=%2Fangular%2Fangular-cli%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fangular%2Fangular-cli%2Fissues%2Fnew%2Fchoose
clydinhttps://github.com/clydin
angular:mainhttps://github.com/angular/angular-cli/tree/main
roman-garcia:chunk-optimizer-rendered-lengthhttps://github.com/roman-garcia/angular-cli/tree/chunk-optimizer-rendered-length
Conversation 5 https://github.com/angular/angular-cli/pull/34045
Commits 3 https://github.com/angular/angular-cli/pull/34045/commits
Checks 41 https://github.com/angular/angular-cli/pull/34045/checks
Files changed https://github.com/angular/angular-cli/pull/34045/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/34045/files
perf(@angular/build): read rendered module length once per module in chunk optimizer https://github.com/angular/angular-cli/pull/34045/files#top
Show all changes 3 commits https://github.com/angular/angular-cli/pull/34045/files
9d7138e perf(@angular/build): read rendered module length once per module in … roman-garcia Sep 8, 2026 https://github.com/angular/angular-cli/pull/34045/commits/9d7138efa4d881e17cc4bdc0ef55dece480467d4
657a323 Remove performance comments in chunk-optimizer.ts roman-garcia Sep 8, 2026 https://github.com/angular/angular-cli/pull/34045/commits/657a3238867dfdd55f52d2907bbfbd9c62f34783
308c23c Update packages/angular/build/src/builders/application/chunk-optimize… roman-garcia Sep 8, 2026 https://github.com/angular/angular-cli/pull/34045/commits/308c23cc6a416e18aa5cc3bd90e4330a56f481e2
Clear filters https://github.com/angular/angular-cli/pull/34045/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/34045/files
Please reload this pagehttps://github.com/angular/angular-cli/pull/34045/files
packages/angular/build/src/builders/application/chunk-optimizer.tshttps://github.com/angular/angular-cli/pull/34045/files#diff-061d0833d7265745af38e94aac5cfe6cde1980895a11b50afe22a220317912d9
View file https://github.com/roman-garcia/angular-cli/blob/308c23cc6a416e18aa5cc3bd90e4330a56f481e2/packages/angular/build/src/builders/application/chunk-optimizer.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/angular/angular-cli/pull/34045/{{ revealButtonHref }}
https://github.com/angular/angular-cli/pull/34045/files#diff-061d0833d7265745af38e94aac5cfe6cde1980895a11b50afe22a220317912d9
https://github.com/angular/angular-cli/pull/34045/files#diff-061d0833d7265745af38e94aac5cfe6cde1980895a11b50afe22a220317912d9
Please reload this pagehttps://github.com/angular/angular-cli/pull/34045/files
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.