-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark.sh
executable file
·55 lines (45 loc) · 1.4 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
#!/bin/sh
# assumes fast-tldr is installed.
mkdir -p benchmarks && cd benchmarks
TESTPAGE=tar
# get tealdeer
if [ ! -f tealdeer ]; then
wget https://github.com/dbrgn/tealdeer/releases/download/v1.4.1/tldr-linux-x86_64-musl
mv tldr-linux-x86_64-musl tealdeer
chmod +x tealdeer
./tealdeer --update
fi
if [ ! -f tldr-hs ]; then
wget https://github.com/psibi/tldr-hs/releases/download/v0.8.0/tldr-linux-v0.8.0.tar.gz
tar xvzf tldr-linux-v0.8.0.tar.gz
mv tldr tldr-hs
./tldr-hs --update
fi
if [ ! -f tldr-c-client ]; then
wget https://github.com/tldr-pages/tldr-c-client/archive/v1.3.0.zip
unzip v1.3.0.zip
cd tldr-c-client-1.3.0
make
mv ./tldr ../tldr-c-client
cd ..
./tldr-c-client --update
fi
if [ ! -f tldr-bash-client ]; then
wget -qO tldr-bash-client https://4e4.win/tldr
sudo chmod +x tldr-bash-client
./tldr-bash-client update
fi
if [ ! -f tldr-go-client ]; then
wget https://bitbucket.org/djr2/tldr/raw/f412bddb2a583ddd8192587bb33d0260bc4945d0/dist/linux.tar.bz2
tar xvjf linux.tar.bz2
mv dist/build/linux/tldr tldr-go-client
chmod +x tldr-go-client
./tldr-go-client --update
fi
hyperfine --prepare 'sync; echo 3 | sudo tee /proc/sys/vm/drop_caches' \
"tldr $TESTPAGE" \
"./tealdeer $TESTPAGE" \
"./tldr-hs $TESTPAGE" \
"./tldr-c-client $TESTPAGE" \
"./tldr-bash-client $TESTPAGE" \
"./tldr-go-client $TESTPAGE"