Skip to content
Snippets Groups Projects
Commit aa0cbf9e authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

caches: run the cache warming in parrallel when possible

If gnu-parallel is available, let us it to speed up cache warming.

Currently each benchmark run spend about 5 minutes checking that cache are up to
date (they are). Doing so in parallel should at least speed things up a bit.
parent a023c03f
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,7 @@
endtime=`date +%s`
echo " checked caches in `expr $endtime - $starttime` seconds"
}
export -f warmcache
listrepos () {
for r in repos/*/.hg repos/partial-references/*/.hg; do
......@@ -89,9 +90,18 @@
echo "Warming caches for all repos"
echo "(use SCMPERF_WARMCACHE=skip to skip it)"
starttime=`date +%s`
for r in `listrepos`; do
warmcache $r
done
if parallel --help | grep -q "man parallel" ; then
# gnu parallel is available
if [ -n "$TESTTMP" ]; then
# avoid random output order in test
EXTRAOPT="--keep-order"
fi
listrepos | parallel $EXTRAOPT warmcache
else
for r in `listrepos`; do
warmcache $r
done
fi
endtime=`date +%s`
echo warming cache took `expr $endtime - $starttime` seconds
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment