renaming python variable is too slow
See original GitHub issueEnvironment data
- VS Code version: 1.47.1
- Extension version (available under the Extensions sidebar): v2020.7.94776
- OS and version: MacOS 10.14.6
- Python version (& distribution if applicable, e.g. Anaconda): 3.7.4
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
- Value of the
python.languageServer
setting: Microsoft
Expected behaviour
Rename a variable succeed in 1 second.
Actual behaviour
Rename a variable succeed in 50 seconds
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
- Find a python script with about 400 lines.
- Right-click a variable and select rename, key in the new name, and press the “Enter” button.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:28 (8 by maintainers)
Top Results From Across the Web
VS Code - Rename symbol too slow for Python - Stack Overflow
It is taking around 5 min to do the renaming (also with variable names). Is this a normal behaviour? I have about 10...
Read more >PythonSpeed/PerformanceTips - Python Wiki
When found to be slow, profiling can show what parts of the program are consuming most of the time. A comprehensive but quick-to-run...
Read more >How to Rename Columns in Pandas — With Upto 4X Speed
Pandas' performance gets slowed down by copying going on underneath the hood. Looking at renaming columns, let's see how the hidden copying mechanism...
Read more >The 10 Most Common Mistakes That Python Developers Make
Why? Because, as reported here, when the interpreter shuts down, the module's global variables are all set to None . As a result,...
Read more >Do longer variable names make a program slower? - Quora
While I know compilers and interpreters are complex beast that do things we don't expect, in general variable name lengths don't change performance....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I close this issue because it’s resolved by using
"python.languageServer": "Pylance"
as the language server. The renaming can be done immediately even in a file with ~3000 lines of Python code.@MaxFBurg You may have to file this on the language servers depending on which one you are using. If you have
Jedi
as the language server it usesrope
for refactoring.rope
is outdated and slow. At this point we are transitioning people from Jedi to JediLSP, so try JediLSP as the language server setting and see if it helps. If you still feel it is slow then please file a bug on https://github.com/davidhalter/jediIf the language server is
Microsoft
, this will also be deprecated soon. So replace that withPylance
(you may need to install pylance extension), and see if it helps. If Pylance is slow then please file a bug on https://github.com/microsoft/pylance-release