Repository navigation
Commit fb43cbd
committed
perf(SourceMapDevToolPlugin): emit .map asset as Buffer to reduce V8 heap
The emitted `.map` asset stays in `compilation.assets` until the build
finishes. Wrapping its JSON in a `RawSource(Buffer)` keeps the bytes in
external memory (1 byte/char) rather than on the V8 heap, where the
same content would otherwise sit as a V8 string for the rest of the
build.
On a 1000-module × 50-chunk synthetic build, peak V8 heap drops from
1422 MB to 1041 MB (-27%) with no change in wall-clock time. Also drops
the unused `task.asset` field.
Refs #209611 parent 46f1d0f commit fb43cbd
2 files changed
Lines changed: 20 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
| |||
116 | 115 | | |
117 | 116 | | |
118 | 117 | | |
119 | | - | |
120 | 118 | | |
121 | 119 | | |
122 | 120 | | |
| |||
523 | 521 | | |
524 | 522 | | |
525 | 523 | | |
526 | | - | |
527 | 524 | | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
528 | 534 | | |
529 | 535 | | |
530 | 536 | | |
531 | | - | |
| 537 | + | |
532 | 538 | | |
533 | 539 | | |
534 | 540 | | |
| |||
574 | 580 | | |
575 | 581 | | |
576 | 582 | | |
577 | | - | |
| 583 | + | |
578 | 584 | | |
579 | 585 | | |
580 | 586 | | |
| |||
600 | 606 | | |
601 | 607 | | |
602 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
603 | 613 | | |
604 | 614 | | |
605 | 615 | | |
| |||
0 commit comments