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
According to @dstaley it can take tens of seconds for process.report.getReport to return on a win32 system. The results of this should be cached in some way that doesn't also require hacks to reset that cache during testing.
Expected Behavior
No response
Steps To Reproduce
No response
Environment
No response
The text was updated successfully, but these errors were encountered:
Just adding some additional context I've come across:
Slow execution time for getReport has been "fixed" in node with the addition of the report.excludeNetwork option. This should be safe to add since it's a noop on older versions of Node.
Other package managers (yarn and pnpm (via detect-libc)) check the file contents of /usr/bin/ldd for the presence of a glibc string as a shortcut, but that's hacky since the file contents can be literally whatever.
Also, just noting that even if this value is cached, users will still incur the cost of executing process.report.getReport() at least once, which can add upwards of 30s to installation time.
I think caching is the right balance of doing things correctly, but as fast as possible inside those parameters. We will not be string pattern matching the ldd bin.
Even if excludeNetwork made the call much faster this is still probably a good thing to cache since it's not expected to change inside a given runtime, and is called an unbounded number of times based on how many optional dependencies are in your tree that have a libc field.
wraithgar
changed the title
[BUG] process.report.getReport() is very very slow on wsl2
[BUG] process.report.getReport() is very very slow on win32
Mar 18, 2024
An alternative that would technically work and be correct but is probably not the right path for npm itself would be to use node_gyp and expose a direct call to ctypes.CDLL, which is what node uses under the hood to get that information.
Is there an existing issue for this?
Current Behavior
According to @dstaley it can take tens of seconds for
process.report.getReport
to return on a win32 system. The results of this should be cached in some way that doesn't also require hacks to reset that cache during testing.Expected Behavior
No response
Steps To Reproduce
No response
Environment
No response
The text was updated successfully, but these errors were encountered: