Skip to content

Instantly share code, notes, and snippets.

@walkermatt
Last active August 29, 2015 14:04
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 walkermatt/99181c8454233fca2c8d to your computer and use it in GitHub Desktop.
Save walkermatt/99181c8454233fca2c8d to your computer and use it in GitHub Desktop.
GNU Parallel all the things!
find /var/data/osmm/ -type f -print0 | \
parallel -0 python loader.py loader.config "src_dir={}"
time for FILE in `find . -name '*.shp' -not -path "./tools/*"`; do \
BASE=`basename $FILE .shp`; \
shp2pgsql -W LATIN1 -s 4326 -I $FILE world.$BASE \
| psql; done
real 6m14.569s
time find . -name '*.shp' -not -path "./tools/*" \
| parallel "shp2pgsql -W LATIN1 -s 4326 -I {} world.{/.} | psql"
real 3m11.030s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment