Skip to content

Commit 76b3a50

Browse files
committed
perf(release): optimize sandbox creation with tar pipe
Replace cp + rm with tar pipe for sandbox directory copying. This provides significant performance improvements by: - Excluding directories during copy (not after) - Using tar's optimized bulk operations - Eliminating separate rm -rf cleanup Performance impact: - Sandbox tests: 50s+ → 2.45s (~20x faster) - Full parallel suite: 31.71s → 26.56s (16% faster) - Overall from baseline: 42.94s → 26.56s (38% faster) Excluded directories: .git, .release-state, node_modules, .tasks, tmp
1 parent 6909f23 commit 76b3a50

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

release.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,14 @@ function release::sandbox::create() {
375375
release::log_info "Creating sandbox at: $SANDBOX_DIR"
376376

377377
# Copy repo content excluding .git, .release-state, node_modules
378-
# Using cp + rm for portability (rsync not available on all systems)
379-
cp -r . "$SANDBOX_DIR/"
380-
rm -rf "$SANDBOX_DIR/.git" "$SANDBOX_DIR/.release-state" "$SANDBOX_DIR/node_modules"
378+
# Use tar pipe for faster copying and built-in exclusions
379+
tar --exclude='.git' \
380+
--exclude='.release-state' \
381+
--exclude='node_modules' \
382+
--exclude='.tasks' \
383+
--exclude='tmp' \
384+
-cf - . | tar -xf - -C "$SANDBOX_DIR"
385+
381386
release::log_verbose "Copied project files to sandbox"
382387
}
383388

0 commit comments

Comments
 (0)