forked from boyter/scc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbenchmark.sh
182 lines (136 loc) · 7.42 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
#!/bin/bash
# Assumes we need to install everything from scratch on a box for benchmarking
# Also assumes we have copied the ./examples/performance_tests/create_performance_test.py file to where this is run
apt-get install build-essential unzip cloc sloccount
wget https://github.com/boyter/scc/releases/download/v1.0.0/scc-1.0.0-x86_64-unknown-linux.zip
unzip scc-1.0.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.0.0
wget https://github.com/boyter/scc/releases/download/v1.1.0/scc-1.1.0-x86_64-unknown-linux.zip
unzip scc-1.1.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.1.0
wget https://github.com/boyter/scc/releases/download/v1.2.0/scc-1.2.0-x86_64-unknown-linux.zip
unzip scc-1.2.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.2.0
wget https://github.com/boyter/scc/releases/download/untagged-928286b8064e2cf6dd35/scc-1.3.0-x86_64-unknown-linux.zip
unzip scc-1.3.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.3.0
wget https://github.com/boyter/scc/releases/download/v1.4.0/scc-1.4.0-x86_64-unknown-linux.zip
unzip scc-1.4.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.4.0
wget https://github.com/boyter/scc/releases/download/v1.5.0/scc-1.5.0-x86_64-unknown-linux.zip
unzip scc-1.5.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.5.0
wget https://github.com/boyter/scc/releases/download/v1.6.0/scc-1.6.0-x86_64-unknown-linux.zip
unzip scc-1.6.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.6.0
wget https://github.com/boyter/scc/releases/download/v1.7.0/scc-1.7.0-x86_64-unknown-linux.zip
unzip scc-1.7.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.7.0
wget https://github.com/boyter/scc/releases/download/v1.8.0/scc-1.8.0-x86_64-unknown-linux.zip
unzip scc-1.8.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.8.0
wget https://github.com/boyter/scc/releases/download/v1.9.0/scc-1.9.0-x86_64-unknown-linux.zip
unzip scc-1.9.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.9.0
wget https://github.com/boyter/scc/releases/download/v1.10.0/scc-1.0.0-x86_64-unknown-linux.zip
unzip scc-1.0.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.10.0
wget https://github.com/boyter/scc/releases/download/v1.11.0/scc-1.11.0-x86_64-unknown-linux.zip
unzip scc-1.11.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.11.0
wget https://github.com/boyter/scc/releases/download/v1.12.0/scc-1.12.0-x86_64-unknown-linux.zip
unzip scc-1.12.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.12.0
wget https://github.com/boyter/scc/releases/download/v1.12.1/scc-1.12.1-x86_64-unknown-linux.zip
unzip scc-1.12.1-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc1.12.1
wget https://github.com/boyter/scc/releases/download/v2.0.0/scc-2.0.0-x86_64-unknown-linux.zip
unzip scc-2.0.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc2.0.0
wget https://github.com/boyter/scc/releases/download/v2.1.0/scc-2.1.0-x86_64-unknown-linux.zip
unzip scc-2.1.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc2.1.0
wget https://github.com/boyter/scc/releases/download/v2.2.0/scc-2.2.0-x86_64-unknown-linux.zip
unzip scc-2.2.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc2.2.0
wget https://github.com/boyter/scc/releases/download/v2.3.0/scc-2.3.0-x86_64-unknown-linux.zip
unzip scc-2.3.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc2.3.0
wget https://github.com/boyter/scc/releases/download/v2.4.0/scc-2.4.0-x86_64-unknown-linux.zip
unzip scc-2.4.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc2.4.0
wget https://github.com/boyter/scc/releases/download/v2.5.0/scc-2.5.0-x86_64-unknown-linux.zip
unzip scc-2.5.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc2.5.0
wget https://github.com/boyter/scc/releases/download/v2.6.0/scc-2.6.0-x86_64-unknown-linux.zip
unzip scc-2.6.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc2.6.0
wget https://github.com/boyter/scc/releases/download/v2.7.0/scc-2.7.0-x86_64-unknown-linux.zip
unzip scc-2.7.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc2.7.0
wget https://github.com/boyter/scc/releases/download/v2.8.0/scc-2.8.0-x86_64-unknown-linux.zip
unzip scc-2.8.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc2.8.0
wget https://github.com/boyter/scc/releases/download/v2.9.0/scc-2.9.0-x86_64-unknown-linux.zip
unzip scc-2.9.0-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc2.9.0
wget https://github.com/boyter/scc/releases/download/v2.9.1/scc-2.9.1-x86_64-unknown-linux.zip
unzip scc-2.9.1-x86_64-unknown-linux.zip
mv scc /usr/local/bin/scc2.9.1
wget https://github.com/boyter/scc/releases/download/v2.10.0/scc-2.10.0-x86_64-unknown-linux.zip
unzip scc-2.10.0-x86_64-unknown-linux.zip
cp scc /usr/local/bin/scc2.10.0
mv scc /usr/local/bin/scc
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install ripgrep hyperfine tokei loc
wget https://github.com/vmchale/polyglot/releases/download/0.5.24/poly-x86_64-unknown-linux-icc
mv poly-x86_64-unknown-linux-icc /usr/local/bin/polyglot
wget https://github.com/hhatto/gocloc/releases/download/v0.3.0/gocloc_0.3.0_Linux_x86_64.tar.gz
tar zxvf gocloc_0.3.0_Linux_x86_64.tar.gz
mv gocloc /usr/local/bin/
# TODO want to get a build for loccount here at some point
# Now setup all of the benchmarks
mkdir artifical
cp create_performance_test.py artifical
cd artifical
python create_performance_test.py
cd ..
rm artifical/create_performance_test.py
# Clone the stuff we want to test
git clone --depth=1 https://github.com/antirez/redis.git
git clone --depth=1 https://github.com/python/cpython.git
git clone --depth=1 https://github.com/torvalds/linux.git
# Setup torture test
mkdir linux10
cp -R linux linux10/0
cp -R linux linux10/1
cp -R linux linux10/2
cp -R linux linux10/3
cp -R linux linux10/4
cp -R linux linux10/5
cp -R linux linux10/6
cp -R linux linux10/7
cp -R linux linux10/8
cp -R linux linux10/9
# Setup uber torture test
mkdir linux100
cp -R linux10 linux100/linux0
cp -R linux10 linux100/linux1
cp -R linux10 linux100/linux2
cp -R linux10 linux100/linux3
cp -R linux10 linux100/linux4
cp -R linux10 linux100/linux5
cp -R linux10 linux100/linux6
cp -R linux10 linux100/linux7
cp -R linux10 linux100/linux8
cp -R linux10 linux100/linux9
# Regression test all versions of scc
hyperfine 'scc-1.0.0 linux' 'scc-1.1.0 linux' 'scc-1.2.0 linux' 'scc-1.3.0 linux' 'scc-1.4.0 linux' 'scc-1.5.0 linux' 'scc-1.6.0 linux' 'scc-1.7.0 linux' 'scc-1.8.0 linux' 'scc-1.9.0 linux' 'scc-1.10.0 linux' 'scc-1.11.0 linux' 'scc-1.12.0 linux' 'scc-1.12.1 linux' 'scc-2.0.0 linux' 'scc-2.1.0 linux' 'scc-2.2.0 linux' 'scc-2.3.0 linux' 'scc-2.4.0 linux' 'scc-2.5.0 linux' 'scc-2.6.0 linux' 'scc-2.7.0 linux' 'scc-2.8.0 linux' 'scc-2.9.0 linux' 'scc-2.9.1 linux' 'scc-2.10.0 linux'
# Benchmark against everything
hyperfine 'scc artifical' 'scc -c artifical' 'tokei artifical' 'loc artifical' 'pologlot artifical' 'gocloc artifical' 'cloc artifical' 'sloccount artifical'
hyperfine 'scc redis' 'scc -c redis' 'tokei redis' 'loc redis' 'pologlot redis' 'gocloc redis' 'cloc redis' 'sloccount redis'
hyperfine 'scc cypthon' 'scc -c cypthon' 'tokei cypthon' 'loc cypthon' 'pologlot cypthon' 'gocloc cypthon' 'cloc cypthon' 'sloccount cypthon'
hyperfine 'scc linux' 'scc -c linux' 'tokei linux' 'loc linux' 'pologlot linux' 'gocloc linux' 'cloc linux' 'sloccount linux'
hyperfine 'scc linux10' 'scc -c linux10' 'tokei linux10' 'loc linux10' 'pologlot linux10' 'gocloc linux10' 'cloc linux10' 'sloccount linux10'
hyperfine 'scc linux100' 'scc -c linux100' 'tokei linux100' 'loc linux100' 'pologlot linux100' 'gocloc linux100' 'cloc linux100' 'sloccount linux100'
echo "All done!"