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

Slow time to display completions #16342

Closed
alandema opened this issue Sep 3, 2021 · 3 comments
Closed

Slow time to display completions #16342

alandema opened this issue Sep 3, 2021 · 3 comments

Comments

@alandema
Copy link

alandema commented Sep 3, 2021

Problem Description

The completion and snippets are much slower than in other IDEs. Something similar was described in #15042 which is now closed, but I don't feel comfortable with the actual completion in Spyder. This is not a new issue, but only now trying other IDEs I have noticed how slow is the completion in Spyder.

I know this GIFs are not a proof because I can type different anytime, but they meant to demonstrate the almost instantly completion and snippets options showing along with your typing in VSCode and how reliable they are. In Spyder they have a 0.5s to 1s delay to display. The fact is: you have to stop your writing to wait for completion suggestions.

In both cases I was using Kite.

VSCode
vscode

Spyder. Sometimes I also need to navigate to second or third option, even if what I typed has no relation to the first option.
spyder

What steps reproduce the problem?

  1. Write some code

What is the expected output? What do you see instead?

I would expect to get a fast completion as in other IDEs like VSCode or PyCharm.

Versions

  • Spyder version: 5.1.2 None
  • Python version: 3.9.5 64-bit
  • Qt version: 5.12.10
  • PyQt5 version: 5.12.3
  • Operating System: Windows 10

Dependencies

Mandatory:

atomicwrites >=1.2.0 : 1.4.0 (OK)
chardet >=2.0.0 : 4.0.0 (OK)
cloudpickle >=0.5.0 : 1.6.0 (OK)
cookiecutter >=1.6.0 : 1.7.3 (OK)
diff_match_patch >=20181111 : 20200713 (OK)
intervaltree >=3.0.2 : 3.1.0 (OK)
IPython >=7.6.0 : 7.27.0 (OK)
jedi >=0.17.2;<0.19.0 : 0.18.0 (OK)
jsonschema >=3.2.0 : 3.2.0 (OK)
keyring >=17.0.0 : 23.1.0 (OK)
nbconvert >=4.0 : 6.1.0 (OK)
numpydoc >=0.6.0 : 1.1.0 (OK)
paramiko >=2.4.0 : 2.7.2 (OK)
parso >=0.7.0;<0.9.0 : 0.8.2 (OK)
pexpect >=4.4.0 : 4.8.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=5.3 : 5.8.0 (OK)
pygments >=2.0 : 2.10.0 (OK)
pylint >=2.5.0;<2.10.0 : 2.9.6 (OK)
pyls_spyder >=0.4.0 : 0.4.0 (OK)
pylsp >=1.2.2;<1.3.0 : 1.2.2 (OK)
pylsp_black >=1.0.0 : None (OK)
qdarkstyle =3.0.2 : 3.0.2 (OK)
qstylizer >=0.1.10 : 0.2.1 (OK)
qtawesome >=1.0.2 : 1.0.3 (OK)
qtconsole >=5.1.0 : 5.1.1 (OK)
qtpy >=1.5.0 : 1.10.0 (OK)
rtree >=0.9.7 : 0.9.7 (OK)
setuptools >=49.6.0 : 52.0.0.post20210125 (OK)
sphinx >=0.6.6 : 4.1.2 (OK)
spyder_kernels >=2.1.1;<2.2.0 : 2.1.1 (OK)
textdistance >=4.2.0 : 4.2.1 (OK)
three_merge >=0.1.1 : 0.1.1 (OK)
watchdog >=0.10.3 : 2.1.5 (OK)
zmq >=17 : 22.2.1 (OK)

Optional:

cython >=0.21 : None (OK)
matplotlib >=2.0.0 : 3.4.3 (OK)
numpy >=1.7 : 1.21.2 (OK)
pandas >=1.1.1 : 1.3.2 (OK)
scipy >=0.17.0 : 1.7.1 (OK)
sympy >=0.7.3 : None (OK)

@ccordoba12 ccordoba12 changed the title Slow code completion and snippets Slow time to display completions Sep 6, 2021
@ccordoba12
Copy link
Member

ccordoba12 commented Sep 6, 2021

Hey @alandema, thanks for reporting. After thinking about this problem for some days, I noticed that during the migration to the new API we have in Spyder 5, we lost an important configurable option that we exposed in Spyder 4: Show automatic completions after keyboard idle.

That option tells Spyder to wait for a bit (300 milliseconds by default) before requesting and showing completions. We do this for two reasons:

  • We prefer not to clutter the code editing experience by showing a changing list a lot of completion results while typing.
  • We also don't want to send too many requests to the server in charge of completions to not cause possible deadlocks on it.

However, by exposing that option again (which I plan to do in our 5.2.0 version), setting its value to 0, and setting the other options shown below

imagen

(for now it's necessary to disable completion snippets, we'll see if we can avoid that in 5.2.0), you'll get a much closer experience to what you see in VSCode/Pycharm:

slow_completions

@alandema
Copy link
Author

alandema commented Sep 6, 2021

Indeed, I missed the latency option in 5.1.2 when I searched for it. Glad to know that we will get a similar experience to VSCode/PyCharm about this feature. At least for me, this helps me a lot to code faster without typos.

@isabela-pf
Copy link
Collaborator

We talked about this in a meeting today, and since it seems like there's not a technical blocker I agree it's better to meet user expectations where we can.

This includes removing the delay as default and providing configuration in preferences.

@ccordoba12 ccordoba12 modified the milestones: v5.2.0, v5.2.1 Nov 8, 2021
@ccordoba12 ccordoba12 modified the milestones: v5.2.1, v5.2.2 Nov 26, 2021
@ccordoba12 ccordoba12 modified the milestones: v5.2.2, v5.3.0 Dec 19, 2021
@ccordoba12 ccordoba12 modified the milestones: v5.3.0, v5.3.1 Mar 10, 2022
@ccordoba12 ccordoba12 modified the milestones: v5.3.1, v5.3.2 Apr 9, 2022
@ccordoba12 ccordoba12 modified the milestones: v5.3.2, v5.3.3 May 4, 2022
@ccordoba12 ccordoba12 modified the milestones: v5.3.3, v5.3.4 Jun 20, 2022
@ccordoba12 ccordoba12 modified the milestones: v5.3.4, v5.3.3 Jul 30, 2022
@ccordoba12 ccordoba12 modified the milestones: v5.3.3, v5.3.4 Aug 17, 2022
@ccordoba12 ccordoba12 removed this from the v5.4.0 milestone Oct 5, 2022
@ccordoba12 ccordoba12 added this to the v5.4.1 milestone Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants