Poor performance for Python code navigation after upgrade

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Extremely poor performance navigating Python codebase

Steps to Reproduce

  1. Upgrade to the latest version of Cursor.
  2. Try to navigate a Python codebase which already existed, such as finding references to a class method
  3. Performance is poor, sometimes taking a minute to complete.

Expected Behavior

Performance should be comparable to before the upgrade

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.5.11
VSCode Version: 1.99.3
Commit: 2f2737de9aa376933d975ae30290447c910fdf40
Date: 2025-09-05T03:48:32.332Z
Electron: 34.5.8
Chromium: 132.0.6834.210
Node.js: 20.19.1
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.6.0

Does this stop you from using Cursor

Yes - Cursor is unusable

Hi @Robert_Blankenship, could you try adding paths to cursorpyright.analysis.exclude? This will limit the # of files that are getting analyzed, which should help improve performance.

I didn’t need to exclude any paths before. Could you explain why this is necessary now?

Also, it would be good to provide guidelines for how many Python files Cursor supports.

We don’t have a hard limit on the # of files; it will depend on the resources of your computer.

The implementation in the new extension is different, so having excluded folders will help with performance.

Could you provide any info about how to debug it? Logs to look for? How to know which folders are causing the problem?

TBH, I would prefer to revert, if possible.

The “Cursor - Pyright” and “basedpyright” output consoles would contain logs for the Python language server.

Even after reducing it to 800 files it’s still slow:

[Info - 12:30:07 PM] Found 837 source files

And that’s after ignoring my .venv folder, which doesn’t feel super great as I’d like to freely navigate between project source and dependencies

+1. Me and my team having same issue post update. Unusable unfortunately. We have a python mono-repo & pretty sure any enterprise level company writing python code outside of a pet project will hit this if the performance is bad on 800 files. Especially because my dev machine is pretty beefy…

@ravirahman :

  1. Why was Pylance removed in favor of Anysphere Python
  2. Is Cursor aware of this issue and the severity and is there any plan / path to improve the performance? Need to know so I can advise my team how much to invest in other alternatives.

I do not have this issue with any other IDE which suggests the performance is miles off on Anysphere

6 Likes

Was experiencing the same issue. Uninstalling the Python extension and installing pyrefly and ty as suggested here Cursor pyright slooooooow - #7 by ravirahman fixed it for me

This new anysphere Python plugin also has odd behavior for code completion, unreachable code parsing, and handling custom text color settings. In a DRF view anytime you call “get_object()” it is saying all the code beneath it is unreachable. Does not behave like the MS python extension.

I am also in a python mono-repo guy, and its frustrating to deal with these issues. Ease of use for Cursor (and VSCode to be fair) for Python is like a 1/10 compared to JetBrains IDEs. I would love to see more from the Cursor team on the mono-repo python use case.

The option installing ty + pyrefly did not work for us. These tools incorrectly report issues for things that pylance supports.

It would be very helpful to have an answer to @Ryan_St_Pierre ‘s questions. It has been multiple weeks with no clarity. So to re-hash

A) Anysphere is not ready for usage - for any mono-repo of any reasonable size it will crash all resources on your laptop. Our team is experiencing this as well as a lot of other posts I am seeing in this and related threads.

B) ty + pyrefly do not fully emulate the behaviors and performance of pylance

So getting answers to questions 1 and 2 above are essential in us determining next steps. Can we have an update @ravirahman ?

Hi Daniel, I’m on the Pyrefly team. Do you know which behaviors/performance you’d like to see from Pylance?

The main thing for us in particular would be native support for Pydantic. Pydantic I feel like has become quite popular, and pylance correctly supports the intended patterns Pydantic enables.

A very simple example is before validators. e.g.:

from pydantic import BaseModel, field_validator


class Example(BaseModel):
    list_or_str_input: list[str]

    @field_validator("list_or_str_input", mode="before")
    @classmethod
    def validate_list_or_str_input(cls, v: str | list[str]) -> list[str]:
        if isinstance(v, str):
            v = [v]
        return v


this_works = Example(list_or_str_input="single_string")
this_also_works = Example(list_or_str_input=["string1", "string2"])

In practice, there are many more examples and more advanced things you can do as well. But pylance is happy with this code, whereas you get errors if you try anything with pyrefly because it thinks it needs to be list[str] always

We just shipped basic support for Pydantic: Experimental Pydantic Support | Pyrefly. Our sandbox doesn’t support it just yet, but you can see working examples here: GitHub - migeed-z/pyrefly-pydantic-demo: A demo of Pyrefly for Pydantic

If you have any feedback or feature requests, we would love to hear it here: Pydantic v1 feedback · Issue #1078 · facebook/pyrefly · GitHub

If there are other gaps or things you would like to see, please leave an issue or ping us on discord. We’re eager to hear about the specific gaps that people are most interested in.

@lolpack Can Pyrefly rename a python package or move a class to a new file? I’m currently unable to do either on Anysphere.

I’m also looking to be able to quickly navigate the code for a moderately sized repo… expected code navigation to respond within less than a second.

The problems with Python support are enough to make me reinstall Pycharm

2 Likes

remove the Python extension as indicated in the message

We don’t yet support the move features that PyCharm has. We’re tracking those requests here: Extraction-related and Copy/Move refactor support · Issue #746 · facebook/pyrefly · GitHub. Feel free to add more context or upvote the issue. They are definitely popular features that we would like to support at some point. Appreciate the feedback and requests!

We are facing the same issue here. We’ve been using the official “anysphere Python” since pylance was blocked and we are dealing with a lot of performance issues, rendering the IDE quite unusable.

  • “Go to References” doesn’t work anymore. We see the eternal “Finding references…” indicator, but nothing happens and there are no informative logs on Cursor Pyright and basedpyright output tabs
  • “Go to Definition” takes too long. It’s taking 3 to 4 minutes after the click.
  • Renaming files became an impossible task from the IDE.

While comparing against VSCode with pylance, it became clear that this doesn’t seem to be caused by the size of the codebase. It just works there, even without excluding/limiting search paths.

We’d really appreciate some suggestions here (either on investigating where the bottleneck is or with alternative approaches). :folded_hands:

2 Likes

Pyrefly added support for rename/move in 0.38.1. Please try it out and let us know on github if you have issues!

2 Likes