on master help sign in
run-benchmarks.sh: Add new test 'Startup time with syntax highlighting'
commit206bf5b8d60b8cf3fc44d2b3b7a4374df625befb authorMartin Nordholts <enselic@gmail.com> dateThu 25 Nov 2021, 21:20 (5 years ago) parent9a2979d
2 files changed+13
tests/benchmarks/run-benchmarks.sh+10 tests/benchmarks/test-src/small-Markdown-file.md+3
tests/benchmarks/run-benchmarks.sh+10
@@ -93,6 +93,16 @@ hyperfine \
9393cat "$RESULT_DIR/startup-time.md" >> "$REPORT"
9494
9595
96+heading "Startup time with syntax highlighting"
97+hyperfine \
98+ "$(printf "%q" "$BAT") --no-config --color=always test-src/small-Markdown-file.md" \
99+ --command-name "bat … small-Markdown-file.md" \
100+ --warmup "$WARMUP_COUNT" \
101+ --export-markdown "$RESULT_DIR/startup-time-with-syntax-highlighting.md" \
102+ --export-json "$RESULT_DIR/startup-time-with-syntax-highlighting.json"
103+cat "$RESULT_DIR/startup-time-with-syntax-highlighting.md" >> "$REPORT"
104+
105+
96106heading "Plain-text speed"
97107hyperfine \
98108 "$(printf "%q" "$BAT") --no-config --language=txt --style=plain test-src/numpy_test_multiarray.py" \
tests/benchmarks/test-src/small-Markdown-file.mdnew file+3
@@ -0,0 +1,3 @@
1+# Keep this file small, we want to measure bat startup time, not speed of Markdown highlighting!
2+
3+The Markdown syntax definition references ~18 other syntaxes, so without lazy-loading, it will be slow to load.