You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a102613
Browse filesBrowse the repository at this point in the historyBrowse files
fix(performance): read an alias's evidence from the request, not the module (#21786)
* fix(performance): read an alias's evidence from the request, not the module
`unusedAliases` looked for the request as written on `NormalModule.rawRequest`,
which two applied aliases never reach: one resolving to `false` leaves a
`RawModule`, and a context module's elements are resolved relative to the
directory the alias named, so `@locales/en.js` survives only on the context
dependency. Both were reported as never applied — `alias: { fs: false }` is the
common spelling of the first, and the advice is to delete an alias the build
needs.
The fallback pass reads `dependency.request`, and a context dependency's
`options.request`, so a request the graph keeps nowhere else is still counted.
It runs only while something is unaccounted for, as before: a build whose
aliases all match walks no dependencies at all and is unchanged (0.11ms ->
0.15ms over 7 builds, inside the spread). Where one is dead the walk now costs
about a millisecond on 600 modules, which is where a wrong answer would have
been printed.
* perf(performance): ask each distinct request once while walking dependencies
One import states its request on several dependencies, and a shared module is
requested once per importer, so the walk asked the same question repeatedly.
A set of the requests already put to the aliases skips the repeats.
The joined path stays undeduped: it is the issuer's context joined with the
request, so the same request answers differently per module.
Counted, not timed — the machine's spread swamped the hook either way. On 600
modules that all import one shared util: 2403 calls down to 1803. Where every
request is distinct it saves nothing (1802 -> 1801), which is the shape it
cannot help.
0 commit comments