bat/src
Martin Nordholts 9124271eaf
Load independent and minimal syntax sets when using --language (#1787)
This significantly speeds up the startup time of bat, since only a single
linked SyntaxDefinition is loaded for each file. The size increase of the
binary is just ~400 kB.

In order for startup time to be improved, the --language arg must be used, and
it must match one of the following names:

"Plain Text", "ActionScript", "AppleScript", "Batch File", "NAnt Build File",
"C#", "C", "CSS", "D", "Diff", "Erlang", "Go", "Haskell", "JSON", "Java
Properties", "BibTeX", "LaTeX Log", "TeX", "Lisp", "Lua", "MATLAB", "Pascal",
"R", "Regular Expression", "Rust", "SQL", "Scala", "Tcl", "XML", "YAML", "Apache
Conf", "ARM Assembly", "Assembly (x86_64)", "CMakeCache", "Comma Separated
Values", "Cabal", "CoffeeScript", "CpuInfo", "Dart Analysis Output", "Dart",
"Dockerfile", "DotENV", "F#", "Friendly Interactive Shell (fish)", "Fortran
(Fixed Form)", "Fortran (Modern)", "Fortran Namelist", "fstab", "GLSL",
"GraphQL", "Groff/troff", "group", "hosts", "INI", "Jinja2", "jsonnet",
"Kotlin", "Less", "LLVM", "Lean", "MemInfo", "Nim", "Ninja", "Nix", "passwd",
"PowerShell", "Protocol Buffer (TEXT)", "Puppet", "Rego", "resolv", "Robot
Framework", "SML", "Strace", "Stylus", "Solidity", "Vyper", "Swift",
"SystemVerilog", "TOML", "Terraform", "TypeScript", "TypeScriptReact",
"Verilog", "VimL", "Zig", "gnuplot", "log", "requirements.txt", "Highlight
non-printables", "Private Key", "varlink"

Later commits will improve startup time for more code paths.

* fix some typos and misspellings

* CHANGELOG.md: Add Performance section (preliminary)

* Add a CHANGELOG.md entry for this PR
2021-09-09 20:52:33 +02:00
..
bin/bat Load independent and minimal syntax sets when using --language (#1787) 2021-09-09 20:52:33 +02:00
assets.rs Load independent and minimal syntax sets when using --language (#1787) 2021-09-09 20:52:33 +02:00
assets_metadata.rs Replace deprecated 'error-chain' with 'thiserror' (#1820) 2021-08-26 13:12:21 +02:00
build_assets.rs Load independent and minimal syntax sets when using --language (#1787) 2021-09-09 20:52:33 +02:00
config.rs Make 'build-assets' an optional capability for application 2021-08-17 10:58:21 +02:00
controller.rs Fix all lints that are new with Rust 1.54 2021-08-19 07:19:12 +02:00
decorations.rs Reduce public API 2020-04-22 23:55:28 +02:00
diff.rs Improve readability 2021-03-07 14:59:10 +01:00
error.rs Replace deprecated 'error-chain' with 'thiserror' (#1820) 2021-08-26 13:12:21 +02:00
input.rs Fix all lints that are new with Rust 1.54 2021-08-19 07:19:12 +02:00
less.rs Fix for Windows: do not run binaries from CWD 2021-07-12 23:17:30 +02:00
lib.rs Don't take a HighlightingAssets detour to build assets (#1802) 2021-08-24 07:58:03 +02:00
line_range.rs PR comments addressed for line range +delta syntax 2021-08-23 19:55:41 +02:00
macros.rs Introduce bat_warning! helper macro 2020-12-28 09:27:40 +01:00
output.rs Replace deprecated 'error-chain' with 'thiserror' (#1820) 2021-08-26 13:12:21 +02:00
pager.rs Refactor "Use matches macro" 2021-05-27 12:05:07 +02:00
paging.rs Move PagingMode to separate module 2020-04-22 23:55:28 +02:00
preprocessor.rs replace_nonprintable: Keep \n around 2020-12-19 10:27:06 +01:00
pretty_printer.rs HighlightingAssets: Make .syntaxes() and syntax_for_file_name() failable 2021-07-29 08:26:18 +02:00
printer.rs Replace deprecated 'error-chain' with 'thiserror' (#1820) 2021-08-26 13:12:21 +02:00
style.rs style: add component 'rule' for horizontal file delimiter 2020-10-12 09:04:27 +01:00
syntax_mapping.rs Fix broken resolv.conf highlighting 2021-02-16 22:15:31 +01:00
terminal.rs Add ansi theme to replace ansi-light and ansi-dark 2020-12-21 17:05:10 +01:00
wrapping.rs Addressed PR feedback. Upped min version and used matches! macro 2021-01-09 15:21:26 +01:00