Skip to content

perf(@angular/build): avoid encoding intermediate source maps before remapping - #33779

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:perf/generate-decoded-source-maps
Open

perf(@angular/build): avoid encoding intermediate source maps before remapping#33779
clydin wants to merge 1 commit into
angular:mainfrom
clydin:perf/generate-decoded-source-maps

Conversation

@clydin

@clydin clydin commented Aug 5, 2026

Copy link
Copy Markdown
Member

Use generateDecodedMap() instead of generateMap() when intermediate source maps created with MagicString are immediately remapped via @ampproject/remapping.

This applies to:

  • oxc-transform: when an input source map is present
  • oxc-linker: when an input source map is present
  • Sass URL rebasing: intermediate stylesheet rebase maps stored for Sass source map merging

Bypassing VLQ base64 encoding and immediate decoding reduces CPU time and temporary memory allocations during source map generation.

…remapping

Use `generateDecodedMap()` instead of `generateMap()` when intermediate source maps created with `MagicString` are immediately remapped via `@ampproject/remapping`.

This applies to:
- `oxc-transform`: when an input source map is present
- `oxc-linker`: when an input source map is present
- Sass URL rebasing: intermediate stylesheet rebase maps stored for Sass source map merging

Bypassing VLQ base64 encoding and immediate decoding reduces CPU time and temporary memory allocations during source map generation.
@angular-robot angular-robot Bot added area: performance Issues related to performance area: @angular/build labels Aug 5, 2026

@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 sourcemap generation and remapping across several build tools (including the OXC linker, OXC transform, and Sass rebasing importer) by switching from encoded sourcemaps to decoded sourcemaps (DecodedSourceMap). By utilizing generateDecodedMap instead of generateMap when an input sourcemap is present, it avoids unnecessary encoding and decoding overhead. Additionally, corresponding unit tests have been added to verify sourcemap generation and remapping behavior. There are no review comments, so I have no feedback to provide.

@clydin clydin added target: minor This PR is targeted for the next minor release action: review The PR is still awaiting reviews from at least one requested reviewer labels Aug 5, 2026
@clydin
clydin requested a review from alan-agius4 August 6, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/build area: performance Issues related to performance target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant