aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/_defaults.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-09-01 06:21:36 +0800
committerGitHub <noreply@github.com>2024-09-01 06:21:36 +0800
commitea2998fec90ce4666b9b85b2d1a7458e717e2a5a (patch)
tree3bcfe23547778d82716458fb8390e057f6d48810 /runtime/lua/vim/_defaults.lua
parent6f167fcae9fb47f4b03e2b2ae6732540aa409454 (diff)
downloadrneovim-ea2998fec90ce4666b9b85b2d1a7458e717e2a5a.tar.gz
rneovim-ea2998fec90ce4666b9b85b2d1a7458e717e2a5a.tar.bz2
rneovim-ea2998fec90ce4666b9b85b2d1a7458e717e2a5a.zip
vim-patch:9.1.0704: inserting with a count is inefficient (#30206)
Problem: inserting with a count is inefficient Solution: Disable calculation of the cursor position and topline, if a count has been used (Ken Takata) Optimize insertion when using :normal 10000ix. This patch optimizes the insertion with a large count (e.g. `:normal 10000ix`). It seems that calculation of the cursor position for a long line is slow and it takes O(n^2). Disable the calculation if not needed. Before: ``` $ time ./vim --clean -c 'normal 10000ix' -cq! real 0m1.879s user 0m1.328s sys 0m0.139s $ time ./vim --clean -c 'normal 20000ix' -cq! real 0m5.574s user 0m5.421s sys 0m0.093s $ time ./vim --clean -c 'normal 40000ix' -cq! real 0m23.588s user 0m23.187s sys 0m0.140s ``` After: ``` $ time ./vim --clean -c 'normal 10000ix' -cq! real 0m0.187s user 0m0.046s sys 0m0.093s $ time ./vim --clean -c 'normal 20000ix' -cq! real 0m0.217s user 0m0.046s sys 0m0.108s $ time ./vim --clean -c 'normal 40000ix' -cq! real 0m0.278s user 0m0.093s sys 0m0.140s $ time ./vim --clean -c 'normal 80000ix' -cq! real 0m0.494s user 0m0.311s sys 0m0.140s $ time ./vim --clean -c 'normal 160000ix' -cq! real 0m1.302s user 0m1.140s sys 0m0.094s ``` closes: vim/vim#15588 https://github.com/vim/vim/commit/09b80d23cfae24fa13ef4f52b0ec90625839a6ab Co-authored-by: Ken Takata <kentkt@csc.jp>
Diffstat (limited to 'runtime/lua/vim/_defaults.lua')
0 files changed, 0 insertions, 0 deletions