3 ms·
I've noticed that pasting large amounts of text (> 1000 lines) can make it grind to a halt for several minutes. I don't know if it's due to the mode I'm in.
by twblalock 9y ago
I've noticed that pasting large amounts of text (> 1000 lines) can make it grind to a halt for several minutes. I don't know if it's due to the mode I'm in.
- kaushalmodi 9y agoMore than the number of lines, it's the number of characters on a single line that causes the slowdown. Thankfully I don't have a real usage scenario where I handle thousand character line files. I can edit multi-thousand line (5k+) Org documents just fine. So it's probably the major mode or some minor mode(s), or a combination.
- tonyarkles 9y agoIn my experience that's often due to major modes that try to format and syntax-highlight on the fly. Keep in mind that some forms of pasting are really equivalent (from Emacs' PoV) to a crapton of keystrokes being entered. Anyway, the workaround I have for the occasional time I have huge things to paste is to switch the buffer to fundamental-mode before pasting, and then switching back. As a curiosity, what kind of things are you pasting that are that big?
- agumonkey 9y agoFew editable systems are happy with 1K lines. I remember a discussion where only one editor was happy dealing with that, all other became sluggish.
- barrkel 9y ago1k lines does not stress many editors. It only stresses emacs when the major mode is doing lots of stuff to highlight and format. I regularly used other editors on C files with 30k+ lines, 15 years ago when machines were slower. Emacs' real weakness is an over-reliance on regexes for highlighting and poor integration with sources of semantic and symbolic information for richer highlighting, editing and browsing. That, and synchronous operations for the same.
- Dangeranger 9y agoIf you are dealing with large text files of JSON or XML of 1MB or larger you can turn the buffer into Fundamental mode and turn off line numbers. I’ve found that the reason why large files are slow is due to formatting and linting and not the size of bytes on disk. With fundamental mode and no line numbers it feels as fast as Vim or Sublime to me.
- innagadadavida 9y agoLong lines are slow, but it handles well otherwise. For long lines, I disabled bidi-display-reordering and switched to fundamental-mode and it really helps.