perf: Add 24-thread parallel building to build_llvm.sh

- Added -j 24 to cargo build commands (lines 52, 83)
- Consistent with build_jit.sh which already uses 24 threads
- Significantly speeds up LLVM builds on multi-core systems

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Selfhosting Dev
2025-09-14 17:09:16 +09:00
parent 4c0e6726e3
commit 42f6b15f81

View File

@ -47,8 +47,9 @@ echo "[1/4] Building nyash (feature selectable) ..."
_LLVMPREFIX=$(llvm-config-18 --prefix)
# Select LLVM feature: default harness (llvm), or legacy inkwell when NYASH_LLVM_FEATURE=llvm-inkwell-legacy
LLVM_FEATURE=${NYASH_LLVM_FEATURE:-llvm}
# Use 24 threads for parallel build
LLVM_SYS_181_PREFIX="${_LLVMPREFIX}" LLVM_SYS_180_PREFIX="${_LLVMPREFIX}" \
CARGO_INCREMENTAL=1 cargo build --release -p nyash-rust --features "$LLVM_FEATURE" >/dev/null
CARGO_INCREMENTAL=1 cargo build --release -j 24 -p nyash-rust --features "$LLVM_FEATURE" >/dev/null
echo "[2/4] Emitting object (.o) via LLVM backend ..."
# Default object output path under target/aot_objects
@ -78,7 +79,8 @@ echo "[3/4] Building NyRT static runtime ..."
if [[ "${NYASH_LLVM_SKIP_NYRT_BUILD:-0}" == "1" ]]; then
echo " Skipping NyRT build (NYASH_LLVM_SKIP_NYRT_BUILD=1)"
else
( cd crates/nyrt && cargo build --release >/dev/null )
# Use 24 threads for parallel build
( cd crates/nyrt && cargo build --release -j 24 >/dev/null )
fi
echo "[4/4] Linking $OUT ..."