Bug Detail
I was trying to open 1.8 GB JSON file. All the text is on single line. VIM was not responding. When press gj it takes 12 seconds to come to next line. The interesting thing is once I formatted that JSON by below command.
jq . myfile.json > formattedFile.json
Opening this formmattedFile.json, I can navigate without any problem though the file size increased to 2.5 GB.
Even opening VIM with all the plugins I have, the `formattedFile.json' was working fine.
To Reproduce
Detailed steps to reproduce the behavior:
vim --clean (or gvim --clean, etc.)filename with all text on single lineExpected behavior
VIM should be responsive even all the content is on single line.
Environment:
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
how much time did you give vim to become responding again? Have you tried just to wait a bit? Or perhaps just press Ctrl-C a couple of times (might be that the syntax highlighting becomes slow), this should make vim start to become responding again.
Try with a bare vim without any syntax highlighting: vim -u NONE -N and perhaps do some profiling of what vim script is slow. Possibly also check the output of :syntime.
Also, what was the exact vim version please?
@chrisbra VIM became stuck and the syntax highlighting was also off. I have opened vim without any plugin as mentioned above.
My vim version is:
`VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Nov 30 2020 10:19:08)
Included patches: 1-2069
`I have compiled from source code.
so hitting CTRL-C did not make vim re-active? You might need to do some profiling of the vim source to find out what is happening. Does it happen with any large file (single line) or just this particular one?
I think that this is a well known long standing issue.
Handling a very very long line on Vim causes terrible slow down.
I'm not sure about the root cause, though.
so hitting
CTRL-Cdid not make vim re-active? You might need to do some profiling of the vim source to find out what is happening. Does it happen with any large file (single line) or just this particular one?
@chrisbra It only happens with large file (single line) only.
okay, so you should probably do some profiling the vim source to see what is happening.
Here is the profile which I got by using this command
vim --startuptime profile_oneline.log -u NONE bigFile.json
It takes 12 minutes in case if file is not formatted and all the text is in single line.
`
Big File with only one Line :
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.019 000.019: --- VIM STARTING ---
000.376 000.357: Allocated generic buffers
000.584 000.208: locale set
000.597 000.013: window checked
001.725 001.128: inits 1
001.934 000.209: parsing arguments
001.939 000.005: expanding arguments
001.974 000.035: shell init
002.501 000.527: Termcap init
002.524 000.023: inits 2
002.744 000.220: init highlight
002.746 000.002: sourcing vimrc file(s)
002.761 000.015: inits 3
002.778 000.017: setting raw mode
002.794 000.016: start termcap
002.831 000.037: clearing screen
757119.572 757116.741: opening buffers
757119.577 000.005: BufEnter autocommands
757119.579 000.002: editing files in windows
757119.591 000.012: VimEnter autocommands
757119.592 000.001: before starting main loop
791200.137 34080.545: first screen update
791200.140 000.003: --- VIM STARTED ---
`
Big File with multiple lines
It takes 7 seconds in case if file is formatted and text is NOT in single line
In case of formattedFile.json, it has following log.
`
times in msec
clock self+sourced self: sourced script
clock elapsed: other lines
000.020 000.020: --- VIM STARTING ---
000.234 000.214: Allocated generic buffers
000.355 000.121: locale set
000.361 000.006: window checked
001.053 000.692: inits 1
001.198 000.145: parsing arguments
001.202 000.004: expanding arguments
001.255 000.053: shell init
002.086 000.831: Termcap init
002.137 000.051: inits 2
002.678 000.541: init highlight
002.684 000.006: sourcing vimrc file(s)
002.720 000.036: inits 3
002.755 000.035: setting raw mode
002.786 000.031: start termcap
002.833 000.047: clearing screen
7325.757 7322.924: opening buffers
7325.760 000.003: BufEnter autocommands
7325.761 000.001: editing files in windows
7325.772 000.011: VimEnter autocommands
7325.773 000.001: before starting main loop
7325.984 000.211: first screen update
7325.985 000.001: --- VIM STARTED ---
`
Here it takes 7 seconds.
—
You are receiving this because you commented.