Skip to content

perf(@angular/build): optimize template string size calculation in server manifest - #33804

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:perf-manifest-byte-length
Aug 7, 2026
Merged

perf(@angular/build): optimize template string size calculation in server manifest#33804
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:perf-manifest-byte-length

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

Calculates normalized byte lengths for server assets directly using Node.js Buffer.byteLength to avoid script compilation with vm.runInThisContext.

@angular-robot angular-robot Bot added area: performance Issues related to performance area: @angular/build labels Aug 7, 2026
@alan-agius4 alan-agius4 added 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 Aug 7, 2026
@alan-agius4
alan-agius4 requested a review from clydin August 7, 2026 14:52
@alan-agius4
alan-agius4 marked this pull request as ready for review August 7, 2026 14:53
gemini-code-assist[bot]

This comment was marked as outdated.

@alan-agius4
alan-agius4 force-pushed the perf-manifest-byte-length branch from c933475 to 00d5d09 Compare August 7, 2026 14:57
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

/gemini review

gemini-code-assist[bot]

This comment was marked as outdated.

@alan-agius4
alan-agius4 force-pushed the perf-manifest-byte-length branch from 00d5d09 to 6ff2f3e Compare August 7, 2026 15:01
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request optimizes the server asset size calculation in the manifest generation by replacing runInThisContext with a manual calculation that subtracts \r\n occurrences from Buffer.byteLength. The review feedback suggests explicitly importing Buffer from node:buffer to maintain consistency with other Node.js built-in imports and avoid relying on the global namespace.

Comment thread packages/angular/build/src/utils/server-rendering/manifest.ts
@alan-agius4
alan-agius4 force-pushed the perf-manifest-byte-length branch from 6ff2f3e to 52f6ab1 Compare August 7, 2026 15:04
@alan-agius4 alan-agius4 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 Aug 7, 2026
…rver manifest

Calculates normalized byte lengths for server assets directly using Node.js Buffer.byteLength to avoid script compilation with vm.runInThisContext.
@alan-agius4
alan-agius4 force-pushed the perf-manifest-byte-length branch from 52f6ab1 to 9a069b5 Compare August 7, 2026 15:14
@alan-agius4
alan-agius4 merged commit b6269a8 into angular:main Aug 7, 2026
38 of 39 checks passed
@alan-agius4
alan-agius4 deleted the perf-manifest-byte-length branch August 7, 2026 15:19
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build area: performance Issues related to performance target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants