neovim/test/functional
bfredl 8da986ea87 refactor(grid): change schar_T representation to be more compact
Previously, a screen cell would occupy 28+4=32 bytes per cell
as we always made space for up to MAX_MCO+1 codepoints in a cell.

As an example, even a pretty modest 50*80 screen would consume

50*80*2*32 = 256000, i e a quarter megabyte

With the factor of two due to the TUI side buffer, and even more when
using msg_grid and/or ext_multigrid.

This instead stores a 4-byte union of either:
- a valid UTF-8 sequence up to 4 bytes
- an escape char which is invalid UTF-8 (0xFF) plus a 24-bit index to a
  glyph cache

This avoids allocating space for huge composed glyphs _upfront_, while
still keeping rendering such glyphs reasonably fast (1 hash table lookup
+ one plain index lookup). If the same large glyphs are using repeatedly
on the screen, this is still a net reduction of memory/cache
consumption. The only case which really gets worse is if you blast
the screen full with crazy emojis and zalgo text and even this case
only leads to 4 extra bytes per char.

When only <= 4-byte glyphs are used, plus the 4-byte attribute code,
i e 8 bytes in total there is a factor of four reduction of memory use.
Memory which will be quite hot in cache as the screen buffer is scanned
over in win_line() buffer text drawing

A slight complication is that the representation depends on host byte
order. I've tested this manually by compling and running this
in qemu-s390x and it works fine. We might add a qemu based solution
to CI at some point.
2023-09-19 11:25:31 +02:00
..
api Merge pull request #25190 from glepnir/echo_hl 2023-09-17 12:23:22 +02:00
autocmd test: add some tests for SafeState autocommand 2023-08-21 14:16:16 +08:00
core feat(remote): avoid --remote-ui infinite loop (#24465) 2023-08-13 14:14:08 +08:00
editor fix(folds): update folds in Insert mode with fdm=indent (#24402) 2023-07-21 08:56:08 +08:00
ex_cmds fix(messages): use "Vimscript" instead of "VimL" #24111 2023-06-22 04:09:14 -07:00
fixtures feat(lsp): map K to hover by default #24331 2023-07-14 09:47:18 -07:00
legacy feat(extmark): support proper multiline ranges 2023-09-12 10:38:23 +02:00
lua fix(lua): not using global value in vim.opt_global (#25196) 2023-09-17 06:35:12 +08:00
options test(options/defaults_spec): fix NVIM_APPNAME test flakiness (#24553) 2023-08-04 10:37:47 +08:00
plugin test(plugin/man_spec): use pesc() on actual_file in pattern (#25199) 2023-09-17 06:07:53 +08:00
provider fix(messages): use "Vimscript" instead of "VimL" #24111 2023-06-22 04:09:14 -07:00
shada fix(shada): update marks when using delmarks! (#24978) 2023-09-03 10:34:09 +08:00
terminal test(tui_spec): update cursor_address test for wrap flag (#25228) 2023-09-18 12:16:32 +08:00
treesitter fix(languagetree): apply resolve_lang to metadata['injection.language'] 2023-09-16 11:12:06 +01:00
ui refactor(grid): change schar_T representation to be more compact 2023-09-19 11:25:31 +02:00
vimscript fix(tests): set SHELL=sh #24941 2023-09-11 10:01:00 -07:00
example_spec.lua
helpers.lua feat(extmark): support proper multiline ranges 2023-09-12 10:38:23 +02:00
preload.lua test: remove unused variable (#21552) 2022-12-29 07:20:42 +08:00