Skip to content

Commit d742196

Browse files
committed
Optimize 'libexec/build-monolith' on Linux
Use `xargs` to build the `ar` command line instead of running `ar` manually to reduce startup costs. Build the symbol table after adding each file instead of continually rebuilding it.
1 parent e35a4fa commit d742196

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

libexec/build-monolith

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ case "${platform}" in
3333
/usr/bin/ranlib "${LIBV8_MONOLITH}"
3434
;;
3535
"Linux")
36-
find . -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | while read -r obj; do
37-
ar -cq "${LIBV8_MONOLITH}" "${obj}"
38-
done
36+
find . -path "./torque_*/**/*.o" -or -path "./v8*/**/*.o" -or -path "./icu*/**/*.o" | sort | uniq | xargs ar -cqS "${LIBV8_MONOLITH}"
37+
ranlib "${LIBV8_MONOLITH}"
3938
;;
4039
*)
4140
echo "Unsupported platform: ${platform}"

0 commit comments

Comments
 (0)