Repository navigation
Replies: 2 comments
|
Measured on Windows x64 — and the cost is not Android-only. It is paid on every startup on every platform where the addon does load successfully. Same code path (
Three interleaved runs, a fresh process each, same Electron/Node instance used for both arms. Correctness: all five modules return values strictly So where the addon works, this one call spends ~1.1 s inside the install phase doing what a direct The fix described in the original post ( |
Follow-up: what entry resolution actually costs inside a full cold startupSame machine as my comment above (Desktop 0.2.1-rc.2, Electron 44.7.0 / Node 24.21.0, win32-x64, ~225 plugins, launched with The 5.39 s before
So ~92% of that phase is stat/realpath on package entries — the same work the resolver does per candidate prefix. Two observations that may save someone a day:
One item on the same startup path that is not resolver-related, for completeness: the usage poller calls Caveats, because they matter here: the cache win has one warm sample behind it (the pre-active speedup is probably warm-start, not the patch), there is no click-to-interactive A/B yet, and the 4–11 s stalls that remain after everything is active are still unattributed ( I posted the same data as an update under #10081; happy to fold it into one thread if you prefer. |
Uh oh!
There was an error while loading. Please reload this page.
What happens
On Android (dsh running inside an app sandbox, Node 24.18.0, arm64),
dsh webdies at startup:node-addon-require-builtinpublishes prebuilds for linux/darwin/win only, so on Android requiring it always throws. Related: #6982 (same addon, 0.1.6-alpha.2) and #9093 (building the addon for Android by hand).The repo already solves this, just not here
packages/boot/hmr/src/package-manifest.ts:packages/boot/app-boot/src/profile-resolution/resolver.ts:614goes straight to the addon instead:So a process started with
--expose-internals— which can reach every internal module this function needs without any native code — still dies here.This is what regressed Android between 0.1.5 and 0.2. In 0.1.5 the only consumer on the startup path was the vendored cordis loader, which has the fallback, so
--expose-internalswas enough to boot. 0.2 added this resolver, and it is still written this way onmasteratdsh-v0.2.1-alpha.1.Measured
Redmi 23113RKC6C, Android 16, arm64, Node 24.18.0 started with
--expose-internals. All five internal modules resolve through a plainrequire, and every shape checkinternalModules()performs afterwards passes:{"node":"24.18.0","modern":true,"resolveSync":"function","moduleJob":"function", "resolveFilename":"function","getCjsConditions":"function", "getDefaultConditions":"function","defaultResolve":"function"}Worker threads inherit
execArgv, and the internal require works there too — which matters because the bundled output ships a second copy of this function inlib/worker/profile-resolution-bootstrap.js.With
internalModules()changed to try--expose-internalsfirst, dsh0.2.0-rc.2starts normally on the device and prints itsdsh web: http://127.0.0.1:<port>line. Nothing else was changed.Suggested fix
Have
internalModules()use the same lookuphmralready uses —--expose-internalsfirst, the addon second. That costs nothing on platforms where the addon exists, and removes the hard dependency on a prebuild for this code path.It does not make Android a supported target by itself, but it does mean one less platform-specific binary standing between dsh and any environment the addon was never built for.
All reactions