-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbenchmark.sh
executable file
·59 lines (50 loc) · 1.09 KB
/
benchmark.sh
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
#!/usr/bin/env bash
#
# Quick script to generate a big git status change to compare performance of
# scmpuff with scm_breeze.
#
# For this just populates a fake git repo so I can do some manual timing on it.
#
DIR=/tmp/scmpuff/bench
# make bench directory
rm -rf ${DIR}
mkdir -p ${DIR}
# make it a git repo
cd ${DIR}
git init .
k=25
# make 25 files in git history (no changes)
for ((i=0;i<k;i++)); do
F=$(mktemp foo.XXXX)
echo "X" > ${F}
git add ${F}
done
git commit -m "added some files"
# make 25 files in git history with staged changes
for ((i=0;i<k;i++)); do
F=$(mktemp foo.XXXX)
echo "X" >> ${F}
git add ${F}
git commit -m "added a file" ${F}
echo "Y" >> ${F}
git add ${F}
done
# make 25 files in git history with unstaged changes
for ((i=0;i<k;i++)); do
F=$(mktemp foo.XXXX)
echo "X" >> ${F}
git add ${F}
git commit -m "added a file" ${F}
echo "Y" >> ${F}
done
# make 25 new files to be added
for ((i=0;i<k;i++)); do
F=$(mktemp foo.XXXX)
echo "X" >> ${F}
git add ${F}
done
# make 25 untracked files
for ((i=0;i<k;i++)); do
F=$(mktemp foo.XXXX)
echo "X" >> ${F}
done