rspack: [Bug]: rsbuild dev taking 5 seconds to build (slow)
Version
System:
OS: Linux 6.12 Void
CPU: (32) x64 Intel(R) Core(TM) i9-14900K
Memory: 60.00 GB / 62.57 GB
Container: Yes
Shell: 5.9 - /bin/zsh
npmPackages:
@rsbuild/core: ^1.2.16 => 1.2.16
Details
On vanilla rsbuild example, it takes my Void Linux computer 5 seconds to make the dev build.
This doesn’t happen to me on remote environments, macOS, etc.
Switching between npm or pnpm and versions of node did not make a difference.
I tried installing rsdoctor and it appears there is no obvious explanation. Perhaps I/O or network related.
The “Network” listening portion of the cli tool output shows immediately and the delay only happens after the “build started” output.
Not sure how to provide better details of what could be causing the slowdown on this particular machine.
start build started...
ready built in 5.11 s (web)
Also, on a normal rsbuild build call, the build is relatively snappy…
Reproduce link
https://github.com/jchook/rsbuild-bug-repro
Reproduce Steps
Steps to reproduce:
pnpm create rsbuild@latest– pick all default optionscd rsbuild-projectpnpm dev
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (6 by maintainers)
this is generated by napi-rs https://github.com/napi-rs/napi-rs/blob/06215529d8ca06a4c791e415c6f16eab29de8089/cli/src/api/templates/js-binding.ts#L83
thank you for your kind word, close this since it’s resolved and we will add
process.report.excludeNetwork = trueto napi-rs directly so others will not be bite by this again.@jchook try setting
process.report.excludeNetwork = truehttps://github.com/nodejs/node/pull/55602/files#diff-7ecd0ac3f95fc9d42101c12bfe501ecb4ce9a8c725c80f72d0374fe2192fd84cR81 and see whether it stills takes such long timeseems a known Node.js issue about getReport performance https://github.com/nodejs/node/issues/46060
Thanks, that was really easy and clear.
I opened the files in the recommended visualization tools and see lots of dead space, so it feels like an I/O block or timeout of 5s.
Edit: btw I’m not on musl – using glibc.
trace.json
CPU.20250326.004437.27891.0.001.cpuprofile