akinsho / bufferline.nvim

A snazzy bufferline for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: performance issue with 3000 buffers

Marskey opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

When I open many files, around 3000 in my case, it causes significant delays when using bnext or even when entering insert mode or command mode.

What did you expect to happen?

None

Config

None

Additional Information

...

commit

No response

commented

@Marskey 3000 buffers is a super high number to have open save frankly well beyond anything I'd ever use or test with but you also haven't said anything that implicates this plugin. Please at least provide concrete evidence that this plugin is the slowdown and profile where that might be happening.

Realistically this is a pretty wild edge case in not sure if optimise for anyway

I suppose there maybe have some autocmds that cause this problem. when I disable bufferline plugin, everything is fine for me.

While using Neovim, I occasionally encounter performance issues, and I'm not sure what causes them. Every time I restart Neovim, the issues disappear, and at that point, the number of buffers is only around 68. The problem manifests as high input latency, delayed buffer switching, and sluggishness when entering command mode. To investigate the root cause, I experimented by opening as many buffers as possible and selectively disabling different plugins. I've observed that the performance is significantly affected when toggling the Bufferline plugin on and off.

commented

@Marskey I built bufferline largely based on my on usage which rarely if ever exceeds 40 buffers or so. So when fetching the list of buffers or storing them I don't really optimise for a huge list size since I never do that and never imagined that someone would.

I appreciate that that's your usage/experience and I'm all for improving assumptions about how buffer lists should be handled but optimising for a list in the thousands isn't my first priority by a long shot. As you yourself can see it's largely just me maintaining this plugin and there are dozens of open issues not to mention things I plan to add or change that aren't tracked. In short PRs/help re. implementation welcome if not this issue is destined for the pile of feature/enhancement requests.

Its up to you. should I close this issue?

commented

@Marskey I'll close this for now. If someone else ever comes back with a similar issue, perhaps they will be interested in contributing a fix. Or if enough people are bothered by this and I end up having the time I can look into it. But in the several years this plugin has existed. This is the first time I've encountered this so I'll wait to see if it comes up again