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

run: prewarm cache before run

I started seeing benchmark failing because `hg debugupdatecache` covers more
data in some core changesets (so taking extra time to warm some cold cache).
Instead we perform an extensive cache warming in the preparation steps.

Once the cache are warm the `hg debugupdatecache` run are "fast". See inline
documentation for details.

We also introduce a way to skip this step as it might be slow.
parent 370df857
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,20 @@
hg clone https://www.mercurial-scm.org/repo/hg mercurial
fi
if [ "$SCMPERF_WARMCACHE" != "skip" ] ; then
# get to the highest revision for future cache warming
if [ -n "$TESTTMP" ]; then
# do a lesser, quicker and quieter version of the setup for tests
(cd mercurial;
unset HGWITHRUSTEXT;
make clean --silent > /dev/null 2>&1;
make local --silent "PURE=--pure --quiet" > /dev/null 2>&1;);
else
hg -R mercurial update --clean -r "max(branch(default))"
(cd mercurial; make local );
fi
fi
./script/setup-repos ./default.repos ./repos
python ./create_skip_file.py
......@@ -25,3 +39,33 @@
./script/setup-repos ./default.repos ./repos
python ./create_skip_file.py
# We prewarm all caches with the latest know mercurial changeset.
#
# This avoid the `hg debugupdatecache` run happening within the benchmark to
# take too long, leading to benchmark failing from timing out.
#
# However, this is not ideal because more agressive cache warming usually led
# to performance gain. So running caching warming from "later version" can
# artificially speed up timing from "later version".
#
# This is a trade-off. Having a risk of sightly too fast timing in some case
# seems a lesser evil than having many benchmark failing from timeout. The
# status without this pre-warming was not great either because the version used
# for the last cache warming was not controled either.
#
# The main concrete issue with this approach is that even on warm cache `hg
# debugupdatecache` can take some time multiple seconds. given the large number
# of repositories used in scm-perf. This can adds up to a couple of minutes.
if [ "$SCMPERF_WARMCACHE" != "skip" ] ; then
starttime=`date +%s`
for r in repos/*/.hg repos/partial-references/*/.hg; do
r="`dirname $r`"
echo checking caches for: $r
# dropping HGRC to avoid user extension interfering
HGRCPATH= mercurial/hg -R "$r" debugupdatecache
done
endtime=`date +%s`
echo warming cache took `expr $endtime - $starttime` seconds
fi
......@@ -153,6 +153,11 @@
* files updated, 0 files merged, 0 files removed, 0 files unresolved (glob) (?)
+ '[' '!' -d mercurial ']'
+ hg clone https://www.mercurial-scm.org/repo/hg mercurial
+ '[' -n $TESTTMP ']'
+ cd mercurial
+ unset HGWITHRUSTEXT
+ make clean --silent
+ make local --silent 'PURE=--pure --quiet'
+ ./script/setup-repos ./default.repos ./repos
2 repositories to setup in $TESTTMP/test-asv/repos
Setting up reference repository: smoke-test-A-11eb1fef
......@@ -178,6 +183,83 @@
partial reference: same
already up to date
+ python ./create_skip_file.py
++ date +%s
+ starttime=* (glob)
+ for r in repos/*/.hg repos/partial-references/*/.hg
++ dirname repos/smoke-test-A-11eb1fef-reference/.hg
+ r=repos/smoke-test-A-11eb1fef-reference
+ echo checking caches for: repos/smoke-test-A-11eb1fef-reference
checking caches for: repos/smoke-test-A-11eb1fef-reference
+ HGRCPATH=
+ mercurial/hg -R repos/smoke-test-A-11eb1fef-reference debugupdatecache
+ for r in repos/*/.hg repos/partial-references/*/.hg
++ dirname repos/smoke-test-B-4324509a-reference/.hg
+ r=repos/smoke-test-B-4324509a-reference
+ echo checking caches for: repos/smoke-test-B-4324509a-reference
checking caches for: repos/smoke-test-B-4324509a-reference
+ HGRCPATH=
+ mercurial/hg -R repos/smoke-test-B-4324509a-reference debugupdatecache
+ for r in repos/*/.hg repos/partial-references/*/.hg
++ dirname repos/partial-references/smoke-test-A-11eb1fef-partial-last-hundred/.hg
+ r=repos/partial-references/smoke-test-A-11eb1fef-partial-last-hundred
+ echo checking caches for: repos/partial-references/smoke-test-A-11eb1fef-partial-last-hundred
checking caches for: repos/partial-references/smoke-test-A-11eb1fef-partial-last-hundred
+ HGRCPATH=
+ mercurial/hg -R repos/partial-references/smoke-test-A-11eb1fef-partial-last-hundred debugupdatecache
+ for r in repos/*/.hg repos/partial-references/*/.hg
++ dirname repos/partial-references/smoke-test-A-11eb1fef-partial-last-ten/.hg
+ r=repos/partial-references/smoke-test-A-11eb1fef-partial-last-ten
+ echo checking caches for: repos/partial-references/smoke-test-A-11eb1fef-partial-last-ten
checking caches for: repos/partial-references/smoke-test-A-11eb1fef-partial-last-ten
+ HGRCPATH=
+ mercurial/hg -R repos/partial-references/smoke-test-A-11eb1fef-partial-last-ten debugupdatecache
+ for r in repos/*/.hg repos/partial-references/*/.hg
++ dirname repos/partial-references/smoke-test-A-11eb1fef-partial-last-thousand/.hg
+ r=repos/partial-references/smoke-test-A-11eb1fef-partial-last-thousand
+ echo checking caches for: repos/partial-references/smoke-test-A-11eb1fef-partial-last-thousand
checking caches for: repos/partial-references/smoke-test-A-11eb1fef-partial-last-thousand
+ HGRCPATH=
+ mercurial/hg -R repos/partial-references/smoke-test-A-11eb1fef-partial-last-thousand debugupdatecache
+ for r in repos/*/.hg repos/partial-references/*/.hg
++ dirname repos/partial-references/smoke-test-A-11eb1fef-partial-same/.hg
+ r=repos/partial-references/smoke-test-A-11eb1fef-partial-same
+ echo checking caches for: repos/partial-references/smoke-test-A-11eb1fef-partial-same
checking caches for: repos/partial-references/smoke-test-A-11eb1fef-partial-same
+ HGRCPATH=
+ mercurial/hg -R repos/partial-references/smoke-test-A-11eb1fef-partial-same debugupdatecache
+ for r in repos/*/.hg repos/partial-references/*/.hg
++ dirname repos/partial-references/smoke-test-B-4324509a-partial-last-hundred/.hg
+ r=repos/partial-references/smoke-test-B-4324509a-partial-last-hundred
+ echo checking caches for: repos/partial-references/smoke-test-B-4324509a-partial-last-hundred
checking caches for: repos/partial-references/smoke-test-B-4324509a-partial-last-hundred
+ HGRCPATH=
+ mercurial/hg -R repos/partial-references/smoke-test-B-4324509a-partial-last-hundred debugupdatecache
+ for r in repos/*/.hg repos/partial-references/*/.hg
++ dirname repos/partial-references/smoke-test-B-4324509a-partial-last-ten/.hg
+ r=repos/partial-references/smoke-test-B-4324509a-partial-last-ten
+ echo checking caches for: repos/partial-references/smoke-test-B-4324509a-partial-last-ten
checking caches for: repos/partial-references/smoke-test-B-4324509a-partial-last-ten
+ HGRCPATH=
+ mercurial/hg -R repos/partial-references/smoke-test-B-4324509a-partial-last-ten debugupdatecache
+ for r in repos/*/.hg repos/partial-references/*/.hg
++ dirname repos/partial-references/smoke-test-B-4324509a-partial-last-thousand/.hg
+ r=repos/partial-references/smoke-test-B-4324509a-partial-last-thousand
+ echo checking caches for: repos/partial-references/smoke-test-B-4324509a-partial-last-thousand
checking caches for: repos/partial-references/smoke-test-B-4324509a-partial-last-thousand
+ HGRCPATH=
+ mercurial/hg -R repos/partial-references/smoke-test-B-4324509a-partial-last-thousand debugupdatecache
+ for r in repos/*/.hg repos/partial-references/*/.hg
++ dirname repos/partial-references/smoke-test-B-4324509a-partial-same/.hg
+ r=repos/partial-references/smoke-test-B-4324509a-partial-same
+ echo checking caches for: repos/partial-references/smoke-test-B-4324509a-partial-same
checking caches for: repos/partial-references/smoke-test-B-4324509a-partial-same
+ HGRCPATH=
+ mercurial/hg -R repos/partial-references/smoke-test-B-4324509a-partial-same debugupdatecache
++ date +%s
+ endtime=* (glob)
++ expr * - * (glob)
+ echo warming cache took * seconds (glob)
warming cache took * seconds (glob)
- Fetching recent changes
- Creating environments
- Discovering benchmarks
......
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