Skip to content

Improve build performance - #108

Merged
mathiasbynens merged 3 commits into
node-unicode:mainfrom
JLHwung:improve-build-performance
Sep 23, 2026
Merged

mathiasbynens merged 3 commits into
node-unicode:mainfrom
JLHwung:improve-build-performance

Conversation

@JLHwung

@JLHwung JLHwung commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

In this PR we improve build performance by two cheap fixes:

  1. Only write changed files. The majority of files in output are unchanged and in a general physical filesystem, reading is faster than writing.
  2. Reduce the parallelism to 4. When there are more workers around, the kernel overhead increases.

Build time:

Without cache (output is removed):

node ./scripts/generate-data.mjs  11.56s user 21.89s system 278% cpu 11.997 total

With cache

node ./scripts/generate-data.mjs  9.09s user 8.33s system 203% cpu 8.554 total

Compared with the benchmark result in #105, the build process is now 15% faster.

More than 4 works increases kernel overhead on APFS system.
Comment thread scripts/utils.mjs Outdated
Co-authored-by: Mathias Bynens <[email protected]>
@mathiasbynens
mathiasbynens merged commit 6bb2993 into node-unicode:main Sep 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants