##// END OF EJS Templates
contrib: explicitly enable perf extension for revset tests...
Olle Lundberg -
r20830:44e80bf2 default
parent child Browse files
Show More
@@ -1,89 +1,89 b''
1 1 #!/bin/bash
2 2
3 3 # Measure the performance of a list of revsets against multiple revisions
4 4 # defined by parameter. Checkout one by one and run perfrevset with every
5 5 # revset in the list to benchmark its performance.
6 6 #
7 7 # - First argument is a revset of mercurial own repo to runs against.
8 8 # - Second argument is the file from which the revset array will be taken
9 9 # If second argument is omitted read it from standard input
10 10 #
11 11 # You should run this from the root of your mercurial repository.
12 12 #
13 13 # This script also does one run of the current version of mercurial installed
14 14 # to compare performance.
15 15
16 16 HG="hg update"
17 PERF="./hg perfrevset"
18 BASE_PERF="hg perfrevset"
17 PERF="./hg --config extensions.perf=contrib/perf.py perfrevset"
18 BASE_PERF="hg --config extensions.perf=contrib/perf.py perfrevset"
19 19
20 20 TARGETS=$1
21 21 shift
22 22 # read from a file or from standard output
23 23 if [ $# -ne 0 ]; then
24 24 readarray REVSETS < $1
25 25 else
26 26 readarray REVSETS
27 27 fi
28 28
29 29 hg update --quiet
30 30
31 31 echo "Starting time benchmarking"
32 32 echo
33 33
34 34 echo "Revsets to benchmark"
35 35 echo "----------------------------"
36 36
37 37 for (( j = 0; j < ${#REVSETS[@]}; j++ ));
38 38 do
39 39 echo "${j}) ${REVSETS[$j]}"
40 40 done
41 41
42 42 echo "----------------------------"
43 43 echo
44 44
45 45 # Benchmark baseline
46 46 echo "Benchmarking baseline"
47 47
48 48 for (( j = 0; j < ${#REVSETS[@]}; j++ ));
49 49 do
50 50 echo -n "${j}) "
51 51 $BASE_PERF "${REVSETS[$j]}"
52 52 done
53 53
54 54 echo
55 55 echo
56 56
57 57 # Benchmark revisions
58 58 for i in $(hg log --template='{rev}\n' --rev $TARGETS);
59 59 do
60 60 echo "----------------------------"
61 61 echo -n "Revision: "
62 62 hg log -r $i --template "{desc|firstline}"
63 63
64 64 echo "----------------------------"
65 65 $HG $i
66 66 for (( j = 0; j < ${#REVSETS[@]}; j++ ));
67 67 do
68 68 echo -n "${j}) "
69 69 $PERF "${REVSETS[$j]}"
70 70 done
71 71 echo "----------------------------"
72 72 done
73 73
74 74 $HG
75 75
76 76 # Benchmark current code
77 77 echo "Benchmarking current code"
78 78
79 79 for (( j = 0; j < ${#REVSETS[@]}; j++ ));
80 80 do
81 81 echo -n "${j}) "
82 82 $PERF "${REVSETS[$j]}"
83 83 done
84 84
85 85
86 86 echo
87 87 echo "Time benchmarking finished"
88 88
89 89
General Comments 0
You need to be logged in to leave comments. Login now