Commit a0f45f9
committed
refactor(@angular/build): optimize test entrypoint name generation
The `getTestEntrypoints` function previously used a series of chained string replacement operations to generate a bundle name from a test file's path. For each file, this created multiple intermediate strings that were immediately discarded.
This commit refactors the name generation logic into a single-pass function. The new implementation iterates over the file's relative path once to construct the final dash-cased name, significantly reducing the number of temporary string allocations and the resulting garbage collector pressure. This provides a performance improvement, particularly in large projects with thousands of test files.1 parent 67e42a4 commit a0f45f9
File tree
1 file changed
+46
-10
lines changed- packages/angular/build/src/builders/unit-test
1 file changed
+46
-10
lines changedLines changed: 46 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 92 | + | |
101 | 93 | | |
102 | 94 | | |
103 | 95 | | |
| |||
112 | 104 | | |
113 | 105 | | |
114 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
115 | 151 | | |
116 | 152 | | |
117 | 153 | | |
| |||
0 commit comments