on 5f6e310 help sign in
bat/tests/benchmarks/comparison.sh
31 lines 883 B history raw
1#!/bin/bash
3if ! which hyperfine > /dev/null 2>&1; then
4 echo "'hyperfine' does not seem to be installed."
5 echo "You can get it here: https://github.com/sharkdp/hyperfine"
6 exit 1
7fi
9SRC="test-src/jquery-3.3.1.js"
12cmd_bat="bat --style=full --color=always --paging=never '$SRC'"
13cmd_bat_simple="bat --plain --wrap=never --tabs=0 --color=always --paging=never '$SRC'"
14cmd_pygmentize="pygmentize -g '$SRC'"
15cmd_highlight="highlight -O truecolor '$SRC'"
16cmd_ccat="ccat --color=always '$SRC'"
17cmd_source_highlight="source-highlight --failsafe --infer-lang -f esc -i '$SRC'"
18cmd_hicat="hicat '$SRC'"
19cmd_coderay="coderay '$SRC'"
20cmd_rouge="rougify '$SRC'"
22hyperfine --warmup 3 \
23 "$cmd_bat" \
24 "$cmd_bat_simple" \
25 "$cmd_pygmentize" \
26 "$cmd_highlight" \
27 "$cmd_ccat" \
28 "$cmd_source_highlight" \
29 "$cmd_hicat" \
30 "$cmd_coderay" \
31 "$cmd_rouge" \