Skip to content

File search via @ symbol is very slow in large projects, possibly due to lack of debounce and search triggering on every character #2772

Closed

Description

@vpckso

Describe the bug:

When using the "@" symbol to search for files in large projects, the search functionality is extremely slow and unresponsive. This significantly impacts the development experience and productivity.

Expected behavior:

The file search should be responsive and provide quick results even in large codebases, with proper debouncing to avoid excessive processing on every keystroke.

Actual behavior:

  • Searching for files with "@" in large projects is very slow
  • The search seems to trigger on every character input without proper debouncing
  • UI becomes unresponsive during search operations
  • Performance degrades significantly as project size increases

Additional context:

It appears that the file search functionality may not be implementing proper debouncing, causing it to execute search operations on every keystroke. In large projects, this results in multiple rapid-fire search requests that create performance bottlenecks and make the feature unusable.

Consider implementing:

  1. Proper debouncing
  2. Optimizing file search algorithms for large codebases
  3. Caching mechanisms to improve response times

Environment:

  • OS: Linux
  • OpenCode Version: 0.11.3

Activity

  1. github-actions commented on Sep 25, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. vpckso commented on Sep 26, 2025

    @vpckso
    Author

    The problem seems resolved after upgrade 0.11.4?

  3. anmorgunov commented on Sep 28, 2025

    @anmorgunov

    Still very slow at 0.12.1

  4. rekram1-node commented on Sep 28, 2025

    @rekram1-node
    Contributor

    Hmm @anmorgunov can you tell me more about your project? How big is it and what language(s)?

  5. anmorgunov commented on Sep 28, 2025

    @anmorgunov

    Actually it's pretty tiny (a new project), just 14 files (python).

    I narrowed the issue a bit:

    • the search is decently fast when I open opencode for the first time
    • if, however, I have some coding session (using supernova / zen), then open a new session with /new w/o exiting opencode, it'll be excruciatingly slow.
    • exiting opencode and entering it again resolves the issue.

    lmk if there are other details that can be useful

  6. rekram1-node commented on Sep 28, 2025

    @rekram1-node
    Contributor

    hmm that is weird ill see if I can replicate

    Edit: @anmorgunov I found the issue, we don't have any timeout for symbol lookups and the python lsp is either taking too long or has some bug, there also doesn't seem to be any debounce setup properly here so if this is really painful you can use the following as a work around for now but I hope to have this better addressed soon.

    Put in your opencode.json:

    {
      "$schema": "https://opencode.ai/config.json",
      "lsp": {
        "pyright": {
          "disabled": true
        }
      }
    }
    
  7. anmorgunov commented on Sep 29, 2025

    @anmorgunov

    @rekram1-node this works for now, thanks!

  8. R44VC0RP commented on Jan 25, 2026

    @R44VC0RP
    Contributor

    This issue appears to be resolved in current versions.

    What was fixed:

    1. Workspace symbol lookup disabled - The LSP workspace symbol lookup that was causing slowness (particularly with pyright) has been disabled. The @ file search now uses only the fast fuzzysort-based file index.

    2. Memory leak fixes - Several memory leak fixes have been merged since this issue was reported, addressing the progressive slowdown when using /new within a session.

    If you're still experiencing slowness, you can disable specific LSP servers via opencode.json:

    {
      "lsp": {
        "pyright": {
          "disabled": true
        }
      }
    }

    If anyone is still experiencing file search slowness on recent versions (v1.1.x), please open a new issue with repro steps. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions