-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathtime_compare.sh
More file actions
executable file
·64 lines (43 loc) · 823 Bytes
/
time_compare.sh
File metadata and controls
executable file
·64 lines (43 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# compare time betwen git and git2
COMMAND="ls-files"
TIMES=1000
EXEC_GIT="$(pwd)/tests/git_repo/git"
EXEC_GIT2="$(pwd)/bin/git2"
TEST_DIR="$(pwd)/tests/git_repo/"
function header() {
echo "* $1 : "
printf "\t"
}
function footer() {
echo ""
}
header "Machine"
uname -a
footer
header "GIT version"
cd tests/git_repo/
cat .git/$(git symbolic-ref HEAD)
cd ../../
footer
header "GIT2 version"
cat .git/$(git symbolic-ref HEAD)
footer
here=$(pwd)
cd $TEST_DIR
function testit() {
i=0
while test $i -lt $TIMES
do
$EXEC_GIT $COMMAND 2>&1 1>/dev/null
i=$(($i + 1))
done
}
header "GIT time"
echo "execute $TIMES times '$EXEC_GIT $COMMAND' in $TEST_DIR"
time testit $EXEC_GIT
footer
header "GIT2 time"
echo "execute $TIMES times '$EXEC_GIT2 $COMMAND' in $TEST_DIR"
time testit $EXEC_GIT2
footer
cd $here