Commit c7cfa90
committed
perf(logger): clean up constructor args after Console initialization
Added memory cleanup by deleting constructor args from WeakMap after Console
is initialized. Once the Console is created, the constructor arguments are
no longer needed and can be garbage collected.
Changes:
- Added privateConstructorArgs.delete(this) in #getConsole()
- Added cleanup in dynamic console method initialization
- Reduces memory footprint for long-lived logger instances1 parent 917930d commit c7cfa90
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| 394 | + | |
| 395 | + | |
394 | 396 | | |
395 | 397 | | |
396 | 398 | | |
| |||
1559 | 1561 | | |
1560 | 1562 | | |
1561 | 1563 | | |
1562 | | - | |
| 1564 | + | |
1563 | 1565 | | |
1564 | 1566 | | |
1565 | 1567 | | |
| |||
1575 | 1577 | | |
1576 | 1578 | | |
1577 | 1579 | | |
| 1580 | + | |
| 1581 | + | |
1578 | 1582 | | |
1579 | 1583 | | |
1580 | 1584 | | |
| |||
0 commit comments