-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
sthagen/sharkdp-bat
#31Labels
Description
Step-by-step:
- Measure the time it takes bat to highlight
examples/simple.rs
without cached assets, i.e. when the assets integrated into the binary are used:
% rm -rf ~/.cache/bat
% hyperfine --export-markdown /dev/tty 'bat --color always examples/simple.rs'
Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
bat --color always examples/simple.rs |
107.4 ± 2.1 | 104.1 | 112.5 | 1.00 |
- Create cached assets that are identical to the integrated assets:
% mkdir -p ~/.cache/bat
% echo "---\nbat_version: 0.18.2" > ~/.cache/bat/metadata.yaml
% cp assets/syntaxes.bin ~/.cache/bat/syntaxes.bin
% cp assets/themes.bin ~/.cache/bat/themes.bin
- Measure again
% hyperfine --export-markdown /dev/tty 'bat --color always examples/simple.rs'
Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
---|---|---|---|---|
bat --color always examples/simple.rs |
115.0 ± 2.1 | 111.9 | 120.1 | 1.00 |
Expected result
There is no significant difference.
Actual result
There is a significant difference.
I will soon create a PR with a proposed fix.