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.

Image

Image

start   build started...
ready   built in 5.11 s (web)

Also, on a normal rsbuild build call, the build is relatively snappy…

Image

Reproduce link

https://github.com/jchook/rsbuild-bug-repro

Reproduce Steps

Steps to reproduce:

  1. pnpm create rsbuild@latest – pick all default options
  2. cd rsbuild-project
  3. pnpm dev

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

You think this is a binding lib issue? I was thinking an rspack change.

So far I don’t see a lot of use of process.report.

➜ rg -i process.report
crates/node_binding/binding.js
12:  if (!process.report || typeof process.report.getReport !== 'function') {
20:    const { glibcVersionRuntime } = process.report.getReport().header

packages/rspack/src/util/bindingVersionCheck.ts
39:	if (!process.report || typeof process.report.getReport !== "function") {
51:		const { glibcVersionRuntime } = process.report.getReport().header;

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 = true to napi-rs directly so others will not be bite by this again.

@jchook try setting process.report.excludeNetwork = true https://github.com/nodejs/node/pull/55602/files#diff-7ecd0ac3f95fc9d42101c12bfe501ecb4ce9a8c725c80f72d0374fe2192fd84cR81 and see whether it stills takes such long time

seems 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.

Image

Image

trace.json

CPU.20250326.004437.27891.0.001.cpuprofile