From 206bf5b8d60b8cf3fc44d2b3b7a4374df625befb Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Thu, 25 Nov 2021 21:20:38 +0100 Subject: [PATCH] run-benchmarks.sh: Add new test 'Startup time with syntax highlighting' --- tests/benchmarks/run-benchmarks.sh | 10 ++++++++++ tests/benchmarks/test-src/small-Markdown-file.md | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 tests/benchmarks/test-src/small-Markdown-file.md 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.