@@ -1,9 +1,23 @@
1+#!/usr/bin/env python
2+#
3+# This script goes through all languages that are supported by 'bat'. For each
4+# language, it loops over the correspoinding file extensions and searches a
5+# given folder for matching files. It calls 'bat' for each of these files and
6+# measures the highlighting speed (number of characters per second). The script
7+# reports files which lead to slow highlighting speeds or errors during the
8+# execution of 'bat'.
9+#
10+# Requirements (external programs):
11+# - bat (in the $PATH)
12+# - fd (https://github.com/sharkdp/fd)
13+# - wc
14+
115import time
216import os
317import subprocess as sp
418
519
6−# Threshold speed in chars per second
20+# Threshold speed, characters per second
721THRESHOLD_SPEED = 20000
822
923# Maximum time we allow `bat` to run