aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_inspector.lua
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2024-11-28 14:34:38 +0800
committerglepnir <glephunter@gmail.com>2024-11-30 18:53:29 +0800
commitd512479115296a2df246ef7afbfa55f057fecae2 (patch)
tree88e8c6366c36ad8f9d4dbae20fb30c7b0f35bb68 /runtime/lua/vim/_inspector.lua
parent344923fe9a4d4966a8faf48d2767bfed181925c5 (diff)
downloadrneovim-d512479115296a2df246ef7afbfa55f057fecae2.tar.gz
rneovim-d512479115296a2df246ef7afbfa55f057fecae2.tar.bz2
rneovim-d512479115296a2df246ef7afbfa55f057fecae2.zip
vim-patch:9.1.0891: building the completion list array is inefficient
Problem: building the completion list array is inefficient Solution: refactor and improve ins_compl_build_pum() func (glepnir) current time complexity is O(n^2). I guess garray is not used here to save memory and avoid efficiency is caused by heap memory allocation. A simple way is to add an extra pointer as a single linked list to store the matching compl_T, and traverse this single linked list to generate compl_match_array. The time complexity is O(n x m). The worst case is m=n, but we can still get a little improvement. Because the if condition does not need to be run at one time. This should be a good solution for now. Later we may be able to complete it in O(lgn) time. But this requires more reconstruction. So this is the first step. closes: #16125 https://github.com/vim/vim/commit/80b662009c0fe8f1728a3f3a2c8013b7eebf6745
Diffstat (limited to 'runtime/lua/vim/_inspector.lua')
0 files changed, 0 insertions, 0 deletions