GitHub Copilot Inline Completion Latency in VS Code: How to Reduce
🔍 WiseChecker

GitHub Copilot Inline Completion Latency in VS Code: How to Reduce

When you type code in VS Code, GitHub Copilot suggests inline completions. If these suggestions appear with a noticeable delay, your coding flow breaks. High latency can stem from network conditions, extension settings, or system resource limits. This article explains the causes of inline completion lag and provides concrete steps to reduce it.

Key Takeaways: Reducing GitHub Copilot Latency in VS Code

  • VS Code settings.json > “github.copilot.enable”: Disable Copilot for file types where you don’t need suggestions to reduce processing overhead.
  • VS Code settings > Extensions > Copilot > “Inline Suggest: Enable”: Toggle this off if you prefer manual trigger with Ctrl+Enter, bypassing automatic inline completions.
  • Network proxy or firewall configuration: Ensure TCP port 443 outbound to api.github.com and all subdomains is allowed for low-latency Copilot requests.

Why GitHub Copilot Inline Completion Latency Occurs

GitHub Copilot relies on a cloud-based AI model. When you pause typing in VS Code, the extension sends your current code context to GitHub’s servers. The server generates a suggestion and sends it back. Each round-trip adds network latency. The extension also waits for a short debounce period to avoid sending too many requests as you type. On the client side, VS Code must parse and render the suggestion. If your machine has limited CPU or memory, rendering can lag.

Several factors can amplify this latency:

Network Round-Trip Time

Copilot’s servers are hosted in GitHub’s data centers. If you are far from the nearest data center or use a congested network, each request takes longer. VPNs and proxies can add extra hops and encryption overhead.

Debounce and Throttling Settings

VS Code’s Copilot extension uses a default debounce interval of 75 milliseconds. If you type faster than this interval, the extension queues requests. The queue can grow, causing older suggestions to be discarded and new ones to take longer to appear.

System Resource Contention

VS Code itself consumes CPU and memory. Large projects with many open files, extensions, or language servers can slow down the editor. When the system is under load, Copilot’s rendering thread may not get enough CPU time, resulting in visual lag.

Steps to Reduce Inline Completion Latency

Follow these steps in order. Test latency after each step to see which change helps most.

  1. Check Your Network Connection
    Run a ping test to api.github.com from your terminal. Use the command ping api.github.com. A round-trip time above 100 milliseconds indicates a slow network. Switch to a wired connection or a faster Wi-Fi band. If you use a VPN, try disconnecting temporarily to see if latency drops.
  2. Increase the Debounce Interval
    Open VS Code settings. Press Ctrl+, to open the Settings editor. Search for “Copilot: Debounce Time”. Increase the value from 75 to 150 or 200 milliseconds. A longer debounce reduces the number of requests sent while you type, giving each request more time to complete before the next one starts.
  3. Disable Copilot for Unsupported File Types
    In VS Code settings, search for “Copilot: Enable”. You will see a list of file types. Uncheck file types where you do not want suggestions, such as Markdown, JSON, or YAML files. This prevents the extension from activating in contexts where suggestions are less useful.
  4. Switch to Manual Trigger Mode
    Set the editor.inlineSuggest.enabled setting to false. Then use Ctrl+Enter to manually request a suggestion. This eliminates automatic inline completions and only fetches suggestions when you explicitly ask for them.
  5. Close Unused Editor Tabs and Extensions
    VS Code performance degrades with many open files. Close tabs you are not using. Disable extensions you do not need, especially those that run language servers or linters on every keystroke. Restart VS Code after disabling extensions.
  6. Update VS Code and the Copilot Extension
    Use the latest version of VS Code and the GitHub Copilot extension. Updates often include performance improvements and bug fixes. Go to Extensions view, search for GitHub Copilot, and check for updates.
  7. Reduce Project Size or Use a .gitignore
    Copilot considers all files in your workspace as context. If your project contains large generated files, exclude them using a .gitignore or by setting github.copilot.advanced settings. This reduces the amount of data sent to the server.

If Latency Persists After the Main Fixes

Some users experience latency even after applying the steps above. These cases often involve environment-specific issues.

Copilot Returns Suggestions Slowly or Not at All

Check the VS Code Developer Tools console for errors. Open Help > Toggle Developer Tools and look for network or authentication errors. A 401 or 403 error indicates an authentication problem. Re-authenticate by running the command GitHub Copilot: Sign Out and then signing in again.

High CPU Usage by Copilot Process

Open the Task Manager on Windows or Activity Monitor on macOS. Look for a process named copilot-agent or github-copilot. If it uses more than 20% CPU consistently, restart VS Code. If the issue repeats, disable Copilot for the current workspace and re-enable it later.

Proxy or Firewall Blocks Copilot Requests

Corporate networks often block outbound connections. Verify that TCP port 443 is open to api.github.com and all subdomains. If you use a proxy, configure VS Code to use it: go to Settings > Application > Proxy and enter your proxy URL. Restart VS Code after changing proxy settings.

GitHub Copilot Free vs GitHub Copilot Pro: Latency Differences

Item GitHub Copilot Free GitHub Copilot Pro
Description Free tier with limited suggestions per month Paid tier with unlimited suggestions and priority server access
Server Priority Standard queue — may see higher latency during peak usage Priority queue — requests are processed faster
Model Context Window Limited to 2,048 tokens Extended to 8,192 tokens for richer context
Supported Languages All major languages All major languages plus experimental support for more
Offline Mode Not available Not available

If you use the Free tier and experience consistent latency, upgrading to Pro may reduce delay because your requests enter a priority queue. However, network and local settings still affect latency regardless of the tier.

You can now measure and reduce GitHub Copilot’s inline completion latency in VS Code. Start by checking your network round-trip time and adjusting the debounce interval. If you still see lag, switch to manual trigger mode with Ctrl+Enter. For the most responsive experience, keep VS Code and the Copilot extension updated, and close unnecessary files and extensions.