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