diff options
author | VanaIgr <vanaigranov@gmail.com> | 2024-02-07 01:03:45 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-07 15:03:45 +0800 |
commit | cca8a78ea2ac0803d9e97ee761db9d3e31a77aeb (patch) | |
tree | 38ab066d1aab1b0ece59edb0c193ab5cd3d36877 /runtime/lua/vim/shared.lua | |
parent | 6725565258930ba430cfb925fd1671596a8a4342 (diff) | |
download | rneovim-cca8a78ea2ac0803d9e97ee761db9d3e31a77aeb.tar.gz rneovim-cca8a78ea2ac0803d9e97ee761db9d3e31a77aeb.tar.bz2 rneovim-cca8a78ea2ac0803d9e97ee761db9d3e31a77aeb.zip |
perf: improve utf_char2cells() performance (#27353)
`utf_char2cells()` calls `utf_printable()` twice (sometimes indirectly,
through `vim_isprintc()`) for characters >= 128. The function can be
refactored to call to it only once.
`utf_printable()` uses binary search on ranges of unprintable characters
to determine if a given character is printable. Since there are only 9
ranges, and the first range contains only one character, binary search
can be replaced with SSE2 SIMD comparisons that check 8 ranges at a
time, and the first range is checked separately. SSE2 is enabled by
default in GCC, Clang and MSVC for x86-64.
Add 3-byte utf-8 to screenpos_spec benchmarks.
Diffstat (limited to 'runtime/lua/vim/shared.lua')
0 files changed, 0 insertions, 0 deletions