romgrk / barbar.nvim

The neovim tabline plugin.
2.23k stars 83 forks source link

Any startuptime benchmark? #356

Closed linrongbin16 closed 1 year ago

linrongbin16 commented 1 year ago

Hi, is there a startuptime benchmark? especially compare with bufferline.

Thanks!

Iron-E commented 1 year ago

We haven't provided benchmarks— I personally don't find them to be a measuring stick which is general enough to apply to startup time when it comes to Neovim.

Different systems will respond to certain opimizations better, while others will chug because of added layers of abstraction. If we were to provide a single point of data, users would almost always be able to contradict it with their own testing.

However, I do still think benchmarking is important for the individual. If you'd like to benchmark the two plugins, you can try installing each and then running nvim --startup or time nvim +q (several times to get an average) and then compare the results

Iron-E commented 1 year ago

@linrongbin16 recently I migrated to lazy.nvim for my package manager, which has a brilliant profiler. For yucks I tested barbar.nvim and bufferline.nvim, and got basically the same results:

plugin time (ms)
barbar.nvim 6.96
bufferline.nvim 6.42

As always, test on your own machine.

linrongbin16 commented 1 year ago

thanks so much, I have used the same way.

Iron-E commented 1 year ago

For record keeping, recent commits have reduced startup time by a lot. It's about 3.8–4ms for me now

alexchantastic commented 3 months ago

In the grand scheme of things, this doesn't matter much, but I'm noticing some discrepancies with load times between two systems I'm using. I'd figure I'd share my observations. 😄

One system is on macOS (M1 Macbook Pro) using iTerm2. The other is on Windows 10 running Ubuntu through WSL2 using Windows Terminal.

On average macOS system loads the plugin in about 20ms and the Windows system loads the plugin in about 10ms. This is with the same configuration (see below) and buffers (and files) loaded.

I am loading the plugin through lazy.nvim with this config:

{
  "romgrk/barbar.nvim",
  event = "VeryLazy",
  cond = not vim.g.vscode,
  opts = {
    auto_hide = 1,
    icons = {
      separator = {
        left = "",
        right = "",
      },
      separator_at_end = false,
      inactive = {
        separator = {
          left = "",
          right = "",
        },
      },
    },
  },
  init = function()
    vim.g.barbar_auto_setup = false
  end,
}

Edit: After some additional experimentation, it seems that if I remove event = "VeryLazy" the load times come down to 4ms on macOS and then 6ms on Windows! Odd that they swap in terms of performance!