[Python] How can I improve Copilot’s understanding of hot functions from CPU profiling using...

Discussão em 'Python' iniciado por Stack, Julho 20, 2025.

  1. Stack

    Stack Membro Participativo

    I’ve created MCP that takes CPU profiles to identify hot functions and then sends those functions to GitHub Copilot for auto-suggested fixes.

    The problem is: Copilot’s suggestions often lack context — it doesn’t seem to "understand" the broader architecture, usage patterns, or performance considerations. As a result, the fixes are often irrelevant or shallow.

    To improve this, I’m considering code indexing — similar to what Sourcegraph or Cody does — to feed Copilot more relevant code context (e.g. calling modules, related files, data flow).

    What I'm trying to figure out: How can I implement lightweight code indexing to enhance Copilot's context?

    Is there a way to feed surrounding code or related files into Copilot's context window (maybe via VS Code extensions or API)?

    Are there open-source tools that can help with this?

    I’m open to using embeddings or LSP-based lookups if that’s the best path.

    Any suggestions appreciated!

    Continue reading...

Compartilhe esta Página