Repository navigation
Conversation
Problem: readfile() copies a partial line once per 1 MB read. Solution: grow the read buffer geometrically.
ayroblu
marked this pull request as ready for review
November 15, 2026 15:14
Member
|
thanks |
zeertzjq
pushed a commit
to ayroblu/neovim
that referenced
this pull request
Dec 1, 2026
vim-patch:9.2.1436: reading a file with a very long line is slow Problem: readfile() copies a partial line once per 1 MB read. Solution: Grow the read buffer geometrically. closes: vim/vim#21933 related: vim/vim#15377 vim/vim@e8e1dc8
zeertzjq
pushed a commit
to neovim/neovim
that referenced
this pull request
Dec 1, 2026
vim-patch:9.2.1436: reading a file with a very long line is slow Problem: readfile() copies a partial line once per 1 MB read. Solution: Grow the read buffer geometrically. closes: vim/vim#21933 related: vim/vim#15377 vim/vim@e8e1dc8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was speeding up my vim plugins with the bot and noticed this peculiarity while opening large single line files where the memory usage is huge.
Apparently readfile() copies a partial line once per 1 MB read.
100 MB single-line file:
Same fix as neovim/neovim#42851.
Related: #15377