Commit 10cdeeb
committed
perf(webpack-cli): hold cached argument metadata via WeakRef
The per-schema argument metadata cached for option parsing is large
(~1MB for webpack, ~1.85MB including dev-server) but is only needed
while setting up a command. Storing it via WeakRef lets the GC reclaim
it once setup completes, which matters for long-running serve/watch
sessions. A cache miss simply rebuilds it; in practice V8 keeps the
target alive across the short setup window, so the dedup within a run
(only one schema walk) is preserved.
https://claude.ai/code/session_01PEtzv6Xqv2yXQaQsZaeoSF1 parent 5b4e29e commit 10cdeeb
2 files changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
923 | 923 | | |
924 | 924 | | |
925 | 925 | | |
926 | | - | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
927 | 930 | | |
928 | 931 | | |
929 | | - | |
| 932 | + | |
930 | 933 | | |
931 | 934 | | |
932 | 935 | | |
| |||
937 | 940 | | |
938 | 941 | | |
939 | 942 | | |
940 | | - | |
| 943 | + | |
941 | 944 | | |
942 | 945 | | |
943 | 946 | | |
944 | | - | |
| 947 | + | |
945 | 948 | | |
946 | 949 | | |
947 | 950 | | |
| |||
0 commit comments