Skip to content

Commit

Permalink
run-benchmarks: Benchmark both --wrap=character and --wrap=never
Browse files Browse the repository at this point in the history
  • Loading branch information
Enselic committed Dec 8, 2021
1 parent 36c1ea4 commit 6d0eb07
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions tests/benchmarks/run-benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,16 @@ hyperfine \
cat "$RESULT_DIR/plain-text-speed.md" >> "$REPORT"


for SRC in highlighting-speed-src/*; do
filename="$(basename "$SRC")"

heading "Syntax highlighting speed: \`$filename\`"
hyperfine --warmup "$WARMUP_COUNT" \
"$(printf "%q" "$BAT") --no-config --style=full --color=always --wrap=character --terminal-width=80 '$SRC'" \
--command-name "bat … ${filename}" \
--export-markdown "$RESULT_DIR/syntax-highlighting-speed-${filename}.md" \
--export-json "$RESULT_DIR/syntax-highlighting-speed-${filename}.json"
cat "$RESULT_DIR/syntax-highlighting-speed-${filename}.md" >> "$REPORT"
for wrap in character never; do
for SRC in highlighting-speed-src/*; do
filename="$(basename "$SRC")"

heading "Syntax highlighting speed --wrap=${wrap}: \`$filename\`"
hyperfine --warmup "$WARMUP_COUNT" \
"$(printf "%q" "$BAT") --no-config --style=full --color=always --wrap=${wrap} --terminal-width=80 '$SRC'" \
--command-name "bat … ${filename}" \
--export-markdown "$RESULT_DIR/syntax-highlighting-speed-${filename}.md" \
--export-json "$RESULT_DIR/syntax-highlighting-speed-${filename}.json"
cat "$RESULT_DIR/syntax-highlighting-speed-${filename}.md" >> "$REPORT"
done
done

0 comments on commit 6d0eb07

Please sign in to comment.