1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-21 19:58:15 +03:00
wezterm/termwiz/src
Wez Furlong e188406dfc make semantic zones more cacheable
This commit decomposes the main get_semantic_zones method into two
parts:

* A per-line portion, where the line ranges are cached (invalidated on
  change)
* The overall screen portion, where the line ranges are merged

This changes the overall complexity of computing zones from

   O(width * scrollback-height)

To an incremental:

   O((width * number of changed lines since last query) + scrollback-height)

You can see some samples of elapsed time below; those show the times for
running both the old and the new implementation on the same data.  The
number of lines/zones in the scrollback increases with each call and you
can see that the new implementation is a bit faster anyway at low
volumes but is significantly faster as the number of lines/zones
increases, because the amount of work is reduced.

```
get_semantic_zones: 71.708µs
get_semantic_zones_new: 59.041µs
get_semantic_zones: 71.166µs
get_semantic_zones_new: 9.166µs
get_semantic_zones: 44.291µs
get_semantic_zones_new: 4.208µs
get_semantic_zones: 69.791µs
get_semantic_zones_new: 10.291µs
get_semantic_zones: 59.375µs
get_semantic_zones_new: 7.958µs
get_semantic_zones: 52.5µs
get_semantic_zones_new: 4.5µs
get_semantic_zones: 91.791µs
get_semantic_zones_new: 20.916µs
get_semantic_zones: 229.916µs
get_semantic_zones_new: 109.208µs
get_semantic_zones: 224.125µs
get_semantic_zones_new: 15.208µs
get_semantic_zones: 291.791µs
get_semantic_zones_new: 11.833µs
get_semantic_zones: 238.875µs
get_semantic_zones_new: 12.625µs
get_semantic_zones: 468.458µs
get_semantic_zones_new: 126.583µs
get_semantic_zones: 460.5µs
get_semantic_zones_new: 25.666µs
get_semantic_zones: 358.291µs
get_semantic_zones_new: 19.541µs
get_semantic_zones: 436.833µs
get_semantic_zones_new: 17.875µs
get_semantic_zones: 313.166µs
get_semantic_zones_new: 15.25µs
get_semantic_zones: 333.958µs
get_semantic_zones_new: 16.541µs
get_semantic_zones: 364.666µs
get_semantic_zones_new: 14.041µs
 ```
2022-01-17 22:00:38 -07:00
..
caps termwiz: avoid file io when terminfo db is pre-filled 2021-06-13 09:06:22 -07:00
escape handle ESK k title ST sequence used by tmux 2022-01-17 15:47:39 -07:00
lineedit introduce unicode_version config 2021-11-25 09:00:45 -07:00
render encoding my preferred import grouping in the rustfmt config 2022-01-17 13:50:51 -07:00
surface make semantic zones more cacheable 2022-01-17 22:00:38 -07:00
terminal write -> write_all, h/t clippy via @CGMossa 2022-01-05 18:52:14 -07:00
tmux_cc tmux: capture initial screen contents 2022-01-17 14:36:57 -07:00
widgets fix termwiz compilation when widgets are enabled 2022-01-12 07:14:14 -07:00
cell.rs termwiz: clamp grapheme column width to 2 2021-12-29 21:38:33 -07:00
cellcluster.rs force clusters to break around cursor boundary 2022-01-05 09:20:11 -07:00
color.rs termwiz: s/Fuschia/Fuchsia/g 2021-12-21 20:38:59 -07:00
emoji_presentation.rs termwiz: improve performance of emoji presentation lookup 2021-08-11 23:06:16 -07:00
emoji.rs Respect emoji-variation-sequences.txt 2021-11-25 14:37:24 -07:00
error.rs filedescriptor: remove anyhow from public interface 2021-05-23 14:24:01 -07:00
hyperlink.rs lua: add window::effective_config() method 2021-02-27 12:39:22 -08:00
image.rs term: introduce right&bottom padding to ImageCell 2021-12-23 07:26:49 -07:00
input.rs gui: revise win32-input-mode flow 2022-01-07 13:02:09 -07:00
istty.rs remove some extern crates 2019-05-26 08:27:43 -07:00
keymap.rs clippy 2019-02-24 12:01:08 -08:00
lib.rs move tmux-cc crate to be module inside termwiz 2022-01-17 13:43:35 -07:00
macros.rs termwiz: do not depend on derive_builder 2020-02-11 07:45:50 -08:00
nerdfonts_data.rs Add module to map nerd font symbol names to codepoints 2022-01-16 17:25:08 -07:00
nerdfonts.rs Add module to map nerd font symbol names to codepoints 2022-01-16 17:25:08 -07:00
readbuf.rs restructure termwiz tree prior to merging into wezterm repo 2018-08-05 07:55:30 -07:00
rgb.txt Remove dep on palette for resolving color names 2020-02-07 08:58:53 -08:00
widechar_width.rs termwiz: sync with upstream wichdechar_width 2022-01-01 08:18:41 -07:00