on bce304a help sign in
bat/tests/benchmarks/comparison.sh
33 lines 928 B history raw
1#!/usr/bin/env bash
3cd "$(dirname "${BASH_SOURCE[0]}")"
5if ! which 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
9fi
11SRC="test-src/jquery-3.3.1.js"
14cmd_bat="bat --style=full --color=always --paging=never '$SRC'"
15cmd_bat_simple="bat --plain --wrap=never --tabs=0 --color=always --paging=never '$SRC'"
16cmd_pygmentize="pygmentize -g '$SRC'"
17cmd_highlight="highlight -O truecolor '$SRC'"
18cmd_ccat="ccat --color=always '$SRC'"
19cmd_source_highlight="source-highlight --failsafe --infer-lang -f esc -i '$SRC'"
20cmd_hicat="hicat '$SRC'"
21cmd_coderay="coderay '$SRC'"
22cmd_rouge="rougify '$SRC'"
24hyperfine --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" \