2020-10-04 09:37:37 +00:00
|
|
|
#!/usr/bin/env bash
|
2018-05-25 15:44:50 +00:00
|
|
|
|
2020-11-29 22:41:18 +00:00
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")" || exit
|
2020-10-04 10:07:22 +00:00
|
|
|
|
2020-11-29 22:41:18 +00:00
|
|
|
if ! command -v hyperfine > /dev/null 2>&1; then
|
2018-05-14 19:42:07 +00:00
|
|
|
echo "'hyperfine' does not seem to be installed."
|
|
|
|
echo "You can get it here: https://github.com/sharkdp/hyperfine"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "### Startup time"
|
|
|
|
echo
|
|
|
|
|
|
|
|
hyperfine --warmup 3 bat
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "### Plain text"
|
|
|
|
echo
|
|
|
|
|
|
|
|
hyperfine --warmup 3 "bat --language txt --paging=never 'test-src/jquery-3.3.1.js'"
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "### Time to syntax-highlight large files"
|
|
|
|
echo
|
|
|
|
|
|
|
|
for SRC in test-src/*; do
|
|
|
|
hyperfine --warmup 3 "bat --style=full --color=always --paging=never '$SRC'"
|
|
|
|
done
|