@@ -531,23 +531,30 @@ make test-only
531531
532532#### Speeding up frequent rebuilds when developing
533533
534- If you plan to frequently rebuild Node.js, especially if using several branches,
535- installing ` ccache ` can help to greatly reduce build times. Set up with:
534+ Tips: The ` ccache ` utility is widely used and should generally work fine.
535+ If you encounter any difficulties, consider disabling ` mold ` as a
536+ troubleshooting step.
537+
538+ If you plan to frequently rebuild Node.js, especially if using several
539+ branches, installing ` ccache ` and ` mold ` can help to greatly reduce build
540+ times. Set up with:
536541
537542On GNU/Linux:
538543
539544``` bash
540- sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros
541- export CC=" ccache gcc" # add to your .profile
542- export CXX=" ccache g++" # add to your .profile
545+ sudo apt install ccache mold # for Debian/Ubuntu, included in most Linux distros
546+ export CC=" ccache gcc" # add to your .profile
547+ export CXX=" ccache g++" # add to your .profile
548+ export LDFLAGS=" -fuse-ld=mold" # add to your .profile
543549```
544550
545551On macOS:
546552
547553``` bash
548- brew install ccache # see https://brew.sh
549- export CC=" ccache cc" # add to ~/.zshrc or other shell config file
550- export CXX=" ccache c++" # add to ~/.zshrc or other shell config file
554+ brew install ccache mold # see https://brew.sh
555+ export CC=" ccache cc" # add to ~/.zshrc or other shell config file
556+ export CXX=" ccache c++" # add to ~/.zshrc or other shell config file
557+ export LDFLAGS=" -fuse-ld=mold" # add to ~/.zshrc or other shell config file
551558```
552559
553560This will allow for near-instantaneous rebuilds when switching branches back
@@ -565,6 +572,11 @@ the specified directory. The JS debugger of Visual Studio Code supports this
565572configuration since the November 2020 version and allows for setting
566573breakpoints.
567574
575+ Refs:
576+
577+ 1 . < https://ccache.dev/performance.html >
578+ 2 . < https://github.com/rui314/mold >
579+
568580#### Troubleshooting Unix and macOS builds
569581
570582Stale builds can sometimes result in ` file not found ` errors while building.
0 commit comments