on master help sign in
run-benchmarks.sh: Add new test 'Startup time with syntax highlighting'
206bf5bMartin Nordholts
tests/benchmarks/run-benchmarks.sh+10
@@ -93,6 +93,16 @@ hyperfine \
93cat "$RESULT_DIR/startup-time.md" >> "$REPORT"
93cat "$RESULT_DIR/startup-time.md" >> "$REPORT"
94
94
95
95
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+
96heading "Plain-text speed"
106heading "Plain-text speed"
97hyperfine \
107hyperfine \
98 "$(printf "%q" "$BAT") --no-config --language=txt --style=plain test-src/numpy_test_multiarray.py" \
108 "$(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.