summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Nordholts <enselic@gmail.com>2021-11-25 21:20:38 +0100
committerMartin Nordholts <enselic@gmail.com>2021-11-26 20:14:30 +0100
commit206bf5b8d60b8cf3fc44d2b3b7a4374df625befb (patch)
tree7f5d6e7dc191c238ecb6c2e9ba2d86b0f0b33717
parent9a2979df5fb757cbc8f7e7e537740d00bb300895 (diff)
run-benchmarks.sh: Add new test 'Startup time with syntax highlighting'
-rwxr-xr-xtests/benchmarks/run-benchmarks.sh10
-rw-r--r--tests/benchmarks/test-src/small-Markdown-file.md3
2 files changed, 13 insertions, 0 deletions
diff --git a/tests/benchmarks/run-benchmarks.sh b/tests/benchmarks/run-benchmarks.sh
index 3f3ca902..f7646b45 100755
--- a/tests/benchmarks/run-benchmarks.sh
+++ b/tests/benchmarks/run-benchmarks.sh
@@ -93,6 +93,16 @@ hyperfine \
cat "$RESULT_DIR/startup-time.md" >> "$REPORT"
+heading "Startup time with syntax highlighting"
+hyperfine \
+ "$(printf "%q" "$BAT") --no-config --color=always test-src/small-Markdown-file.md" \
+ --command-name "bat … small-Markdown-file.md" \
+ --warmup "$WARMUP_COUNT" \
+ --export-markdown "$RESULT_DIR/startup-time-with-syntax-highlighting.md" \
+ --export-json "$RESULT_DIR/startup-time-with-syntax-highlighting.json"
+cat "$RESULT_DIR/startup-time-with-syntax-highlighting.md" >> "$REPORT"
+
+
heading "Plain-text speed"
hyperfine \
"$(printf "%q" "$BAT") --no-config --language=txt --style=plain test-src/numpy_test_multiarray.py" \
diff --git a/tests/benchmarks/test-src/small-Markdown-file.md b/tests/benchmarks/test-src/small-Markdown-file.md
new file mode 100644
index 00000000..1a4acf70
--- /dev/null
+++ b/tests/benchmarks/test-src/small-Markdown-file.md
@@ -0,0 +1,3 @@
+# Keep this file small, we want to measure bat startup time, not speed of Markdown highlighting!
+
+The Markdown syntax definition references ~18 other syntaxes, so without lazy-loading, it will be slow to load.