Quirks: editing small files is slow

This commit is contained in:
Marco Hinz 2016-01-09 14:45:32 +01:00
parent 50cdf204d4
commit 756538ed47
2 changed files with 19 additions and 0 deletions

View File

@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
- Tips: [Saner command-line history](README.md#saner-command-line-history) - Tips: [Saner command-line history](README.md#saner-command-line-history)
- Debugging: [Verbosity](README.md#verbosity) - Debugging: [Verbosity](README.md#verbosity)
- Debugging: [Debugging Vim scripts](README.md#debugging-vim-scripts) - Debugging: [Debugging Vim scripts](README.md#debugging-vim-scripts)
- Quirks: [Editing small files is slow](README.md#editing-small-files-is-slow)
- Quirks: [Editing huge files is slow](README.md#editing-huge-files-is-slow) - Quirks: [Editing huge files is slow](README.md#editing-huge-files-is-slow)
- Miscellaneous: [Easter eggs](README.md#easter-eggs) - Miscellaneous: [Easter eggs](README.md#easter-eggs)

View File

@ -60,6 +60,7 @@ added every day. Things about to be added can be found here:
#### [Quirks](#quirks-1) #### [Quirks](#quirks-1)
- [Editing small files is slow](#editing-small-files-is-slow)
- [Editing huge files is slow](#editing-huge-files-is-slow) - [Editing huge files is slow](#editing-huge-files-is-slow)
- [Newline used for NUL](#newline-used-for-nul) - [Newline used for NUL](#newline-used-for-nul)
- [Bracketed paste (or why do I have to set 'paste' all the time?)](#bracketed-paste-or-why-do-i-have-to-set-paste-all-the-time) - [Bracketed paste (or why do I have to set 'paste' all the time?)](#bracketed-paste-or-why-do-i-have-to-set-paste-all-the-time)
@ -1047,6 +1048,23 @@ looking at some distributions:
## Quirks ## Quirks
#### Editing small files is slow
Most of the time this is caused by syntax files using complex regular
expressions. Particulay the Ruby syntax file caused people to have slowdowns in
the past. (Also see [Debugging syntax files](#debugging-syntax-files).)
Moreover, some features tend to impact performance more than others. Check this
list to ease slowdowns:
| Option | Why? |
|--------|------|
| `:set nocursorline` | This makes screen redrawing quite a bit slower. |
| `:set norelativenumber` | Constantly computing the relative numbers is expensive. |
| `:set foldmethod=marker` | If the syntax file itself is slow already, `foldmethod=syntax` makes it even worse. |
| `:set synmaxcol=200` | Due to internal representation, Vim has problems with long lines in general. Only syntax highlight till column 200. |
| `:NoMatchParen` | Uses regular expressions to find the accompanying parenthesis. |
#### Editing huge files is slow #### Editing huge files is slow
The biggest issue with big files is, that Vim reads the whole file at once. This The biggest issue with big files is, that Vim reads the whole file at once. This