preservim / tagbar

Vim plugin that displays tags in a window, ordered by scope
https://preservim.github.io/tagbar
Other
6.09k stars 484 forks source link

tagbar causes a noticeable delay in opening a ~8000 lines C file #863

Open adi-g15 opened 8 months ago

adi-g15 commented 8 months ago

It takes around 4s on my system. Though that number looks small, during opening the file, and on EVERY save, this is very much noticeable.

To reproduce this issue, just try opening defs.h file of the crash-utility.

I am using nvim with vim-plug to manage the plugins, where I found tagbar to be the problem by commenting and uncommenting the tagbar plugin.

nvim --version                       
NVIM v0.9.2
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
...

This is a very useful plugin, but if this is some bug that can be fixed, it will be great. Thanks.

raven42 commented 8 months ago

It is not a bug. It is just the way tagbar was originally written and the implementation of vim at the time. It is a completely serialized process. So actually executing the ctags process on the file and processing the results blocks the main vim thread. This plugin has never been updated to run as a background process and those of us helping maintain it are working on it more from just a maintenance perspective rather than a full development cycle. We are very much open to someone helping out if they want to do some of the heavy lifting, but as of now there are no plans to do a major update of the code like this.