mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
On a large compilation unit with big templates, the total time spent in the `PlainCharacterCursor` constructor was 470ms. This commit applies two optimizations to reduce this time: 1. Avoid the object spread operator within the constructor, as the generated `__assign` helper in the emitted UMD bundle (ES5) does not optimize well compared to a hardcoded object literal. This results in a significant performance improvement. Because of the straight-forward object literal, the VM is now much better able to optimize the memory allocations which makes a significant difference as the `PlainCharacterCursor` constructor is called in tight loops. 2. Reduce the number of `CharacterCursor` clones. Although cloning itself is now much faster because of the optimization above, several clone operations were not necessary. Combined, these changes reduce the total time spent in the `PlainCharacterCursor` constructor to just 10ms. PR Close #34332 |
||
|---|---|---|
| .. | ||
| ast.ts | ||
| html_parser.ts | ||
| html_tags.ts | ||
| html_whitespaces.ts | ||
| icu_ast_expander.ts | ||
| interpolation_config.ts | ||
| lexer.ts | ||
| parser.ts | ||
| tags.ts | ||
| xml_parser.ts | ||
| xml_tags.ts | ||