Neovim for Beginners — Performance

Make Neovim a high-performance code editor.

alpha2phi
6 min readMar 3, 2022

--

Neovim for Beginners — Performance

One main reason we use Vim or Neovim is that we want a high-performance code editor. In this article, we are going to

  • Measure the startup performance
  • Configure the options and plugins to improve the startup performance
  • Measure the performance of opening a large file
  • Configure the options and plugins to improve the performance of opening a large file

This article is part of the Neovim for Beginners series.

The Neovim configuration files can be found in this repository.

Startup Performance

Let’s measure our current startup performance. To do this we can use the startuptime option and write the output to a file.

The performance is measured using a machine running Arch Linux, with an Intel Core i3 processor, and 8GB RAM. Potentially the performance could be much better in your machine.

# nvb --startuptime <file>

Note: nvb is the alias we defined for Neovim.

Measure Startup Time

Looking at the log, we can see it takes 193 milliseconds to start up Neovim, even though we have already installed more than 80 plugins.

Performance Log

We can see the number of installed plugins from the welcome screen.

Welcome Screen with Number of Installed Plugins

The reason it is still fast is that for most of the plugins we installed, we make sure they are lazy-loaded. To see the statuses of the plugins, type :PackerStatus.

Packer Status

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.