Build performance profile

The Rspack CLI supports the use of the RSPACK_PROFILE environment variable for build performance profile.

$ RSPACK_PROFILE=ALL rspack build

This command will generate a .rspack-profile-${timestamp} folder in the current folder, and it will contain logging.json, trace.json and jscpuprofile.json files.

  • trace.json: The time spent on each phase of the Rust side is recorded at a granular level using tracing and can be viewed using ui.perfetto.dev
  • jscpuprofile.json: The time spent at each stage on the JavaScript side is recorded at a granular level using Node.js inspector and can be viewed using speedscope.app
  • logging.json: Includes some logging information that keeps a coarse-grained record of how long each phase of the build took