-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch parser to multi-byte processing
This patch overhauls the `Parser::advance` API to operate on byte slices instead of individual bytes, which allows for additional performance optimizations. VTE does not support C1 escapes and C0 escapes always start with an escape character. This makes it possible to simplify processing if a byte stream is determined to not contain any escapes. The `memchr` crate provides a battle-tested implementation for SIMD-accelerated byte searches, which is why this implementation makes use of it. VTE also only supports UTF8 characters in the ground state, which means that the new non-escape parsing path is able to rely completely on STD's `str::from_utf8` since `memchr` gives us the full length of the plain text character buffer. This allows us to completely remove `utf8parse` and all related code. We also make use of `memchr` in the synchronized escape handling in `ansi.rs`, since it realies heavily on scanning large amounts of text for the extension/termination escape sequences.
- Loading branch information
1 parent
ebc4a4d
commit fbe3273
Showing
16 changed files
with
774 additions
and
1,122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
format_code_in_doc_comments = true | ||
group_imports = "StdExternalCrate" | ||
match_block_trailing_comma = true | ||
condense_wildcard_suffixes = true | ||
use_field_init_shorthand = true | ||
normalize_doc_attributes = true | ||
overflow_delimited_expr = true | ||
imports_granularity = "Module" | ||
format_macro_matchers = true | ||
use_small_heuristics = "Max" | ||
hex_literal_case = "Upper" | ||
normalize_comments = true | ||
reorder_impl_items = true | ||
use_try_shorthand = true | ||
newline_style = "Unix" | ||
format_strings = true | ||
wrap_comments = true | ||
comment_width = 100 |
Oops, something went wrong.