on master help sign in
Move comparison.sh benchmark script to documentation
commit1822c981da238e9629157fb0548a96de84f6ac36 authorDavid Peter <mail@david-peter.de> dateMon 22 Nov 2021, 20:45 (5 years ago) parent5519f9c
2 files changed+39−33
doc/alternatives.md+39 tests/benchmarks/comparison.sh−33
doc/alternatives.md+39
@@ -22,3 +22,42 @@ request.
2222Some other alternatives that are also related, but not yet included in the table:
2323- [lesspipe](https://github.com/wofr06/lesspipe)
2424- [vimpager](https://github.com/rkitover/vimpager)
25+
26+## Benchmarks
27+
28+The benchmarks above have been created with this script:
29+```bash
30+#!/usr/bin/env bash
31+
32+cd "$(dirname "${BASH_SOURCE[0]}")" || exit
33+
34+if ! command -v hyperfine > /dev/null 2>&1; then
35+ echo "'hyperfine' does not seem to be installed."
36+ echo "You can get it here: https://github.com/sharkdp/hyperfine"
37+ exit 1
38+fi
39+
40+SRC="test-src/jquery-3.3.1.js"
41+
42+
43+cmd_bat="bat --style=full --color=always --paging=never '$SRC'"
44+cmd_bat_simple="bat --plain --wrap=never --tabs=0 --color=always --paging=never '$SRC'"
45+cmd_pygmentize="pygmentize -g '$SRC'"
46+cmd_highlight="highlight -O truecolor '$SRC'"
47+cmd_ccat="ccat --color=always '$SRC'"
48+cmd_source_highlight="source-highlight --failsafe --infer-lang -f esc -i '$SRC'"
49+cmd_hicat="hicat '$SRC'"
50+cmd_coderay="coderay '$SRC'"
51+cmd_rouge="rougify '$SRC'"
52+
53+hyperfine --warmup 3 \
54+ "$cmd_bat" \
55+ "$cmd_bat_simple" \
56+ "$cmd_pygmentize" \
57+ "$cmd_highlight" \
58+ "$cmd_ccat" \
59+ "$cmd_source_highlight" \
60+ "$cmd_hicat" \
61+ "$cmd_coderay" \
62+ "$cmd_rouge" \
63+```
tests/benchmarks/comparison.shdeleted−33
@@ -1,33 +0,0 @@
1−#!/usr/bin/env bash
2−
3−cd "$(dirname "${BASH_SOURCE[0]}")" || exit
4−
5−if ! command -v hyperfine > /dev/null 2>&1; then
6− echo "'hyperfine' does not seem to be installed."
7− echo "You can get it here: https://github.com/sharkdp/hyperfine"
8− exit 1
9−fi
10−
11−SRC="test-src/jquery-3.3.1.js"
12−
13−
14−cmd_bat="bat --style=full --color=always --paging=never '$SRC'"
15−cmd_bat_simple="bat --plain --wrap=never --tabs=0 --color=always --paging=never '$SRC'"
16−cmd_pygmentize="pygmentize -g '$SRC'"
17−cmd_highlight="highlight -O truecolor '$SRC'"
18−cmd_ccat="ccat --color=always '$SRC'"
19−cmd_source_highlight="source-highlight --failsafe --infer-lang -f esc -i '$SRC'"
20−cmd_hicat="hicat '$SRC'"
21−cmd_coderay="coderay '$SRC'"
22−cmd_rouge="rougify '$SRC'"
23−
24−hyperfine --warmup 3 \
25− "$cmd_bat" \
26− "$cmd_bat_simple" \
27− "$cmd_pygmentize" \
28− "$cmd_highlight" \
29− "$cmd_ccat" \
30− "$cmd_source_highlight" \
31− "$cmd_hicat" \
32− "$cmd_coderay" \
33− "$cmd_rouge" \