Skip to content

Instantly share code, notes, and snippets.

@KIVagant
Last active October 12, 2016 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KIVagant/d988567ac522135b25fae3a4a862767d to your computer and use it in GitHub Desktop.
Save KIVagant/d988567ac522135b25fae3a4a862767d to your computer and use it in GitHub Desktop.
Subsplit Laravel in parallel processes (example)
# for my symfony-based test project (not for Laravel!) with 7 splitted packages in OSX:
time split-slower # without parallel execution
split-slower 66.71s user 127.59s system 71% cpu 4:30.62 total
time split-faster # with parallel execution
split-faster 99.21s user 148.89s system 236% cpu 1:44.83 total
#!/usr/bin/env bash
# This utility uses linux "parallel"
# To install a fresh version, run:
# apt-get -y install bzip2 make && (wget -O - pi.dk/3 || curl pi.dk/3/ || fetch -o - http://pi.dk/3) | bash
git subsplit init git@github.com:laravel/framework.git
modules_array=(
'src/Illuminate/Auth:git@github.com:illuminate/auth.git'
'src/Illuminate/Bus:git@github.com:illuminate/broadcasting.git'
)
printf '%s\n' "${modules_array[@]}" | parallel echo "'git subsplit publish --heads=\"master 5.2 5.1\" ${1}'"
printf '%s\n' "${modules_array[@]}" | parallel "git subsplit publish --heads='master 5.2 5.1'"
rm -rf .subsplit/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment