CoderCookE / vim-chatgpt

Vim Plugin For ChatGPT
The Unlicense
230 stars 29 forks source link

Lazy-load python scripts #39

Closed armanschwarz closed 4 months ago

armanschwarz commented 5 months ago

Adding this plugin slows down vim load-times quite a bit. On my nvim install it was increasing the load-time from about 200ms to almost a second, which is quite noticable.

The actual load-time for the vim-chatgpt plugin was 644ms, which reduces to 68ms with these fixes.

My suggestion is just to execute the python kernel when needed, rather than doing the imports and function declarations on load.

Note that the creation of the client is very cheap and doesn't involve any network traffic, so doing it for every new request really doesn't add any meaningful performance penalty.