1
0
mirror of https://github.com/sharkdp/bat synced 2026-08-11 20:11:43 +00:00

Reduce startup time in loop-through mode with 80%-90%

Instead of 100 ms - 50 ms, startup takes 10 ms - 5 ms.

HighlightingAssets::get_syntax_set() is never called when e.g. piping the bat
output to a file (see Config::loop_through), so by loading the SyntaxSet only
when needed, we radically improve startup time when it is not needed.
This commit is contained in:
Martin Nordholts
2021-07-22 10:39:39 +02:00
parent 1bac3750df
commit 6acec2c074
4 changed files with 71 additions and 9 deletions
+1
View File
@@ -38,6 +38,7 @@ ansi_term = "^0.12.1"
ansi_colours = "^1.0"
console = "0.14.1"
lazy_static = { version = "1.4", optional = true }
lazycell = "1.0"
wild = { version = "2.0", optional = true }
content_inspector = "0.2.4"
encoding = "0.2"