Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long operation nearly 80 seconds #4459

Closed
Gxinhu opened this issue Jun 7, 2023 · 4 comments
Closed

Long operation nearly 80 seconds #4459

Gxinhu opened this issue Jun 7, 2023 · 4 comments
Assignees
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version needs investigation Could be an issue - needs investigation

Comments

@Gxinhu
Copy link

Gxinhu commented Jun 7, 2023

Recently, I have been attempting to use Visual Studio Code (VSCode) to view Python code from a research paper. However, I have encountered an issue where the Pylance server is performing poorly in certain files, taking almost 80 seconds to respond.

environmental information:

  • Language Server version: 2023.5.50
  • Operating System and version: Ubuntu 22.04 (running in a Docker container)
  • Python version: 3.10

To reproduce the issue:

  1. Open this code lib in vscode, specifically the dataset.py file.
  2. Notice that the performance of VSCode is significantly slower than expected.

Expected behavior:

Fast response and smooth performance.

Actual behavior:

The response time is unacceptably slow.

Logs

2023-06-07 08:11:10.603 [info] [Info  - 8:11:10 AM] (151988) Pylance language server 2023.5.50 (pyright 0d248834) starting
2023-06-07 08:11:10.603 [info] [Info  - 8:11:10 AM] (151988) Server root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist
2023-06-07 08:11:10.608 [info] [Info  - 8:11:10 AM] (151988) Starting service instance "AirfRANS"
2023-06-07 08:11:10.631 [info] [Info  - 8:11:10 AM] (151988) Setting pythonPath for service "AirfRANS": "/usr/bin/python3"
2023-06-07 08:11:10.633 [info] [Warn  - 8:11:10 AM] (151988) stubPath /workspace/fluid_python/AirfRANS/typings is not a valid directory.
2023-06-07 08:11:10.648 [info] [Info  - 8:11:10 AM] (151988) Assuming Python version 3.10
2023-06-07 08:11:10.685 [info] [Info  - 8:11:10 AM] (151988) Found 41 source files
2023-06-07 08:11:10.809 [info] [Info  - 8:11:10 AM] (151988) Background analysis(1) root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist
2023-06-07 08:11:10.811 [info] [Info  - 8:11:10 AM] (151988) Background analysis(1) started
2023-06-07 08:11:15.428 [info] [Info  - 8:11:15 AM] (151988) Indexer background runner(2) root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist (index)
2023-06-07 08:11:15.428 [info] [Info  - 8:11:15 AM] (151988) Indexing(2) started
2023-06-07 08:11:15.691 [info] [Info  - 8:11:15 AM] (151988) scanned(2) 62 files over 1 exec env
2023-06-07 08:11:16.136 [info] [Info  - 8:11:16 AM] (151988) indexed(2) 35 files over 1 exec env
2023-06-07 08:11:16.148 [info] [Info  - 8:11:16 AM] (151988) Indexing finished(2).
2023-06-07 08:11:27.678 [info] [Info  - 8:11:27 AM] (151988) Setting pythonPath for service "AirfRANS": "/home/user/miniconda3/bin/python"
2023-06-07 08:11:27.679 [info] [Warn  - 8:11:27 AM] (151988) stubPath /workspace/fluid_python/AirfRANS/typings is not a valid directory.
2023-06-07 08:11:27.716 [info] [Info  - 8:11:27 AM] (151988) Assuming Python version 3.10
2023-06-07 08:11:27.828 [info] [Info  - 8:11:27 AM] (151988) Found 41 source files
2023-06-07 08:11:28.013 [info] [Info  - 8:11:28 AM] (151988) Indexer background runner(3) root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist (index)
2023-06-07 08:11:28.014 [info] [Info  - 8:11:28 AM] (151988) Indexing(3) started
2023-06-07 08:11:28.231 [info] [Info  - 8:11:28 AM] (151988) scanned(3) 263 files over 1 exec env
2023-06-07 08:11:30.714 [info] [Info  - 8:11:30 AM] (151988) [IDX(3)] Long operation: index execution environment /workspace/fluid_python/AirfRANS (2443ms)
2023-06-07 08:11:30.714 [info] [Info  - 8:11:30 AM] (151988) [IDX(3)] Long operation: index packages /workspace/fluid_python/AirfRANS (2447ms)
2023-06-07 08:11:30.714 [info] [Info  - 8:11:30 AM] (151988) indexed(3) 194 files over 1 exec env
2023-06-07 08:11:30.727 [info] [Info  - 8:11:30 AM] (151988) Indexing finished(3).
2023-06-07 08:11:45.868 [info] [Info  - 8:11:45 AM] (153263) Pylance language server 2023.5.50 (pyright 0d248834) starting
2023-06-07 08:11:45.868 [info] [Info  - 8:11:45 AM] (153263) Server root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist
2023-06-07 08:11:45.873 [info] [Info  - 8:11:45 AM] (153263) Starting service instance "AirfRANS"
2023-06-07 08:11:45.890 [info] [Info  - 8:11:45 AM] (153263) Setting pythonPath for service "AirfRANS": "/home/user/miniconda3/bin/python"
2023-06-07 08:11:45.891 [info] [Warn  - 8:11:45 AM] (153263) stubPath /workspace/fluid_python/AirfRANS/typings is not a valid directory.
2023-06-07 08:11:45.907 [info] [Info  - 8:11:45 AM] (153263) Assuming Python version 3.10
2023-06-07 08:11:45.943 [info] [Info  - 8:11:45 AM] (153263) Found 41 source files
2023-06-07 08:11:46.176 [info] [Info  - 8:11:46 AM] (153263) Background analysis(1) root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist
2023-06-07 08:11:46.176 [info] [Info  - 8:11:46 AM] (153263) Background analysis(1) started
2023-06-07 08:11:46.176 [info] [Info  - 8:11:46 AM] (153263) Indexer background runner(2) root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist (index)
2023-06-07 08:11:46.176 [info] [Info  - 8:11:46 AM] (153263) Indexing(2) started
2023-06-07 08:11:46.385 [info] [Info  - 8:11:46 AM] (153263) scanned(2) 263 files over 1 exec env
2023-06-07 08:11:48.785 [info] [Info  - 8:11:48 AM] (153263) [IDX(2)] Long operation: index execution environment /workspace/fluid_python/AirfRANS (2366ms)
2023-06-07 08:11:48.786 [info] [Info  - 8:11:48 AM] (153263) [IDX(2)] Long operation: index packages /workspace/fluid_python/AirfRANS (2369ms)
2023-06-07 08:11:48.786 [info] [Info  - 8:11:48 AM] (153263) indexed(2) 194 files over 1 exec env
2023-06-07 08:11:48.797 [info] [Info  - 8:11:48 AM] (153263) Indexing finished(2).
2023-06-07 08:12:14.694 [info] [Info  - 8:12:14 AM] (154176) Pylance language server 2023.5.50 (pyright 0d248834) starting
2023-06-07 08:12:14.694 [info] [Info  - 8:12:14 AM] (154176) Server root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist
2023-06-07 08:12:14.699 [info] [Info  - 8:12:14 AM] (154176) Starting service instance "AirfRANS"
2023-06-07 08:12:14.716 [info] [Info  - 8:12:14 AM] (154176) Setting pythonPath for service "AirfRANS": "/home/user/miniconda3/bin/python"
2023-06-07 08:12:14.717 [info] [Warn  - 8:12:14 AM] (154176) stubPath /workspace/fluid_python/AirfRANS/typings is not a valid directory.
2023-06-07 08:12:14.732 [info] [Info  - 8:12:14 AM] (154176) Assuming Python version 3.10
2023-06-07 08:12:14.768 [info] [Info  - 8:12:14 AM] (154176) Found 41 source files
2023-06-07 08:12:14.897 [info] [Info  - 8:12:14 AM] (154176) Background analysis(1) root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist
2023-06-07 08:12:14.898 [info] [Info  - 8:12:14 AM] (154176) Background analysis(1) started
2023-06-07 08:12:15.072 [info] [Info  - 8:12:15 AM] (154176) Indexer background runner(2) root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist (index)
2023-06-07 08:12:15.072 [info] [Info  - 8:12:15 AM] (154176) Indexing(2) started
2023-06-07 08:12:15.194 [info] [Info  - 8:12:15 AM] (154176) scanned(2) 263 files over 1 exec env
2023-06-07 08:12:17.486 [info] [Info  - 8:12:17 AM] (154176) [IDX(2)] Long operation: index execution environment /workspace/fluid_python/AirfRANS (2261ms)
2023-06-07 08:12:17.486 [info] [Info  - 8:12:17 AM] (154176) [IDX(2)] Long operation: index packages /workspace/fluid_python/AirfRANS (2265ms)
2023-06-07 08:12:17.486 [info] [Info  - 8:12:17 AM] (154176) indexed(2) 194 files over 1 exec env
2023-06-07 08:12:17.500 [info] [Info  - 8:12:17 AM] (154176) Indexing finished(2).
2023-06-07 08:12:59.608 [info] [Info  - 8:12:59 AM] (155375) Pylance language server 2023.5.50 (pyright 0d248834) starting
2023-06-07 08:12:59.608 [info] [Info  - 8:12:59 AM] (155375) Server root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist
2023-06-07 08:12:59.614 [info] [Info  - 8:12:59 AM] (155375) Starting service instance "AirfRANS"
2023-06-07 08:12:59.630 [info] [Info  - 8:12:59 AM] (155375) Setting pythonPath for service "AirfRANS": "/home/user/miniconda3/bin/python"
2023-06-07 08:12:59.632 [info] [Warn  - 8:12:59 AM] (155375) stubPath /workspace/fluid_python/AirfRANS/typings is not a valid directory.
2023-06-07 08:12:59.647 [info] [Info  - 8:12:59 AM] (155375) Assuming Python version 3.10
2023-06-07 08:12:59.693 [info] [Info  - 8:12:59 AM] (155375) Found 41 source files
2023-06-07 08:12:59.819 [info] [Info  - 8:12:59 AM] (155375) Background analysis(1) root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist
2023-06-07 08:12:59.821 [info] [Info  - 8:12:59 AM] (155375) Background analysis(1) started
2023-06-07 08:12:59.889 [info] [Info  - 8:12:59 AM] (155375) Indexer background runner(2) root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist (index)
2023-06-07 08:12:59.889 [info] [Info  - 8:12:59 AM] (155375) Indexing(2) started
2023-06-07 08:13:00.127 [info] [Info  - 8:13:00 AM] (155375) scanned(2) 263 files over 1 exec env
2023-06-07 08:13:02.526 [info] [Info  - 8:13:02 AM] (155375) [IDX(2)] Long operation: index execution environment /workspace/fluid_python/AirfRANS (2366ms)
2023-06-07 08:13:02.527 [info] [Info  - 8:13:02 AM] (155375) [IDX(2)] Long operation: index packages /workspace/fluid_python/AirfRANS (2370ms)
2023-06-07 08:13:02.527 [info] [Info  - 8:13:02 AM] (155375) indexed(2) 194 files over 1 exec env
2023-06-07 08:13:02.540 [info] [Info  - 8:13:02 AM] (155375) Indexing finished(2).
2023-06-07 08:13:37.585 [info] [Info  - 8:13:37 AM] (156390) Pylance language server 2023.5.50 (pyright 0d248834) starting
2023-06-07 08:13:37.586 [info] [Info  - 8:13:37 AM] (156390) Server root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist
2023-06-07 08:13:37.591 [info] [Info  - 8:13:37 AM] (156390) Starting service instance "AirfRANS"
2023-06-07 08:13:37.609 [info] [Info  - 8:13:37 AM] (156390) Setting pythonPath for service "AirfRANS": "/home/user/miniconda3/bin/python"
2023-06-07 08:13:37.610 [info] [Warn  - 8:13:37 AM] (156390) stubPath /workspace/fluid_python/AirfRANS/typings is not a valid directory.
2023-06-07 08:13:37.626 [info] [Info  - 8:13:37 AM] (156390) Assuming Python version 3.10
2023-06-07 08:13:37.662 [info] [Info  - 8:13:37 AM] (156390) Found 41 source files
2023-06-07 08:13:37.791 [info] [Info  - 8:13:37 AM] (156390) Background analysis(1) root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist
2023-06-07 08:13:37.793 [info] [Info  - 8:13:37 AM] (156390) Background analysis(1) started
2023-06-07 08:13:37.864 [info] [Info  - 8:13:37 AM] (156390) Indexer background runner(2) root directory: /home/user/.vscode-server/extensions/ms-python.vscode-pylance-2023.5.50/dist (index)
2023-06-07 08:13:37.864 [info] [Info  - 8:13:37 AM] (156390) Indexing(2) started
2023-06-07 08:13:38.167 [info] [Info  - 8:13:38 AM] (156390) scanned(2) 263 files over 1 exec env
2023-06-07 08:13:40.558 [info] [Info  - 8:13:40 AM] (156390) [IDX(2)] Long operation: index execution environment /workspace/fluid_python/AirfRANS (2365ms)
2023-06-07 08:13:40.558 [info] [Info  - 8:13:40 AM] (156390) [IDX(2)] Long operation: index packages /workspace/fluid_python/AirfRANS (2369ms)
2023-06-07 08:13:40.558 [info] [Info  - 8:13:40 AM] (156390) indexed(2) 194 files over 1 exec env
2023-06-07 08:13:40.571 [info] [Info  - 8:13:40 AM] (156390) Indexing finished(2).
2023-06-07 08:15:01.600 [info] [Info  - 8:15:01 AM] (156390) [BG(1)] Long operation: checking: /workspace/fluid_python/AirfRANS/dataset.py (83613ms)
2023-06-07 08:15:01.600 [info] [Info  - 8:15:01 AM] (156390) [BG(1)] Long operation: analyzing: /workspace/fluid_python/AirfRANS/dataset.py (83755ms)
2023-06-07 08:15:03.825 [info] [Info  - 8:15:03 AM] (156390) [BG(1)] Long operation: checking: /workspace/fluid_python/AirfRANS/metrics.py (2180ms)
2023-06-07 08:15:03.825 [info] [Info  - 8:15:03 AM] (156390) [BG(1)] Long operation: analyzing: /workspace/fluid_python/AirfRANS/metrics.py (2196ms)


@StellaHuang95
Copy link
Contributor

Hi @erictraut, just noticed that you created a pyright issue linked to it, would you prefer us to transfer this issue to Pyright?

@erictraut
Copy link
Contributor

It's likely that this is a pyright issue (as opposed to an issue in the pylance language server features), but it's not 100% clear until we do a bit more investigation. Let's leave the two current issues in place for now. Once we have more info, we can decide what to do with the issues.

@StellaHuang95 StellaHuang95 added the needs investigation Could be an issue - needs investigation label Jun 8, 2023
@StellaHuang95 StellaHuang95 added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Jul 18, 2023
@StellaHuang95
Copy link
Contributor

Looks like this has been addressed in pyright. microsoft/pyright#5260. Marking as fixed in the next version.

@heejaechang
Copy link
Contributor

This issue has been fixed in prerelease version 2023.7.31, which we've just released. You can find the changelog here: CHANGELOG.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version needs investigation Could be an issue - needs investigation
Projects
None yet
Development

No branches or pull requests

4 participants