Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with Copilot is very slow #620

Open
lispercat opened this issue Nov 26, 2024 · 7 comments
Open

Integration with Copilot is very slow #620

lispercat opened this issue Nov 26, 2024 · 7 comments
Labels
question Further information is requested

Comments

@lispercat
Copy link

Maybe there is a quick fix for it, but on the same machine when I talk to Copilot (for company account) via the Web interface it takes at most 2 sec, even when it has a lot of context and searches company files.
When CopilotChat it takes ~10 sec even for very simple questions in which I don't ask to analyze any code.
Is there a way to accelerate the process?

@deathbeam
Copy link
Collaborator

Is it only first question or further questions as well? Also depends on model, gpt-4o is a lot faster than claude for example. But on first question the plugin needs to fetch models, agents and check policies, question after will cache this data so should be fine.

@deathbeam deathbeam added the question Further information is requested label Nov 26, 2024
@lispercat
Copy link
Author

it's all questions, first and subsequent. The default gpt-4o is selected.
If I open nvim and just open CopilotChat it's pretty quick but as soon as I open a file from a project it gets really sluggish and seems like to get slower as I keep asking questions.

@deathbeam
Copy link
Collaborator

it's all questions, first and subsequent. The default gpt-4o is selected. If I open nvim and just open CopilotChat it's pretty quick but as soon as I open a file from a project it gets really sluggish and seems like to get slower as I keep asking questions.

well are you opening big file? as the content of the file needs to be sent every time when asking the question (default behaviour is sent whole buffer). and the history also needs to be sent every time, thats how every LLM works mostly. 10 seconds is still a lot tho, maybe it could be also curl related?

Can you output what :checkhealth CopilotChat says?

@deathbeam
Copy link
Collaborator

I merged some optimizations but im still curious about your curl version + the size of file

@lispercat
Copy link
Author

Here is the checkhealth output:
CopilotChat: require("CopilotChat.health").check()

CopilotChat.nvim ~

  • If you are facing any issues, also see :CopilotChatDebugInfo for more information.

CopilotChat.nvim [core] ~

  • OK nvim: NVIM v0.10.1
    Build type: RelWithDebInfo
    LuaJIT 2.1.1713484068
    Run ":verbose version" for more info

CopilotChat.nvim [commands] ~

  • OK curl: curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.17
    Release-Date: 2022-01-05
    Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
    Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets zstd
  • OK git: git version 2.34.1

CopilotChat.nvim [dependencies] ~

  • OK plenary: installed
  • OK copilot: copilot.lua
  • WARNING tiktoken_core: missing, optional for accurate token counting. See README for installation instructions.
  • OK treesitter[markdown]: installed
  • WARNING treesitter[diff]: missing, optional for better diff highlighting. Install "nvim-treesitter/nvim-treesitter" plugin and run ":TSInstall diff".

@deathbeam
Copy link
Collaborator

Can you try on latest canary? Added some status reporting for embedding files as well.

Also how big is the file again? char count/line numbers will do.

You could also try upgrading curl, 7.81 is very old and see if it helps.

@lispercat
Copy link
Author

Looks like upgrading to latest curl (latest from github) doesn't change much.
Also what I noticed is that even for a small project with small file sizes, as the time goes by it gets slower and slower to the point that nvim takes 100% of CPU and I need to restart it. Maybe it's just happening to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants