Skip to content

Qt slow in Spyder when using ipykernel 5.3.3 (5.3.2 OK) #528

Closed

Description

@8bit-Dude

I am using Spyder 4.1.4 on Miniconda3-py37-4.8.3.
I noticed that matplotlib was unsually slow in IPython when using the Qt backend.
Downgrading ipykernel with conda to version 5.3.0 can however fix the issue.

Activity

  1. blink1073 commented on Jul 21, 2020

    @blink1073
    Contributor

    @ccordoba12 might this be related to #525?

  2. DiegoF90 commented on Jul 21, 2020

    @DiegoF90

    I also have the same issue, matplotlib seems to be very slow with the new Spyder 4.1.4.
    I am not sure if it is related to #525, but I had already done the change suggested by @ccordoba12 here and faced this issue later.

  3. DiegoF90 commented on Jul 21, 2020

    @DiegoF90

    I do not know if this is related or f any use but, I was trying to use Tkinter as the graphics backend to see if the speed improved, but after restarting Spyder to apply this changes I got:

    ERROR:tornado.application:Exception in callback functools.partial(<function Kernel.enter_eventloop.<locals>.advance_eventloop at 0x000001D8E9EA4AF0>)
    Traceback (most recent call last):
      File "C:\Users\1520797\AppData\Local\conda\conda\envs\gmv\lib\site-packages\tornado\ioloop.py", line 743, in _run_callback
        ret = callback()
      File "C:\Users\1520797\AppData\Local\conda\conda\envs\gmv\lib\site-packages\ipykernel\kernelbase.py", line 314, in advance_eventloop
        eventloop(self)
      File "C:\Users\1520797\AppData\Local\conda\conda\envs\gmv\lib\site-packages\ipykernel\eventloops.py", line 238, in loop_tk
        app.tk.createfilehandler(stream.getsockopt(zmq.FD), READABLE, notifier)
    AttributeError: '_tkinter.tkapp' object has no attribute 'createfilehandler'
    

    Which is the file referenced from which the problem seems to come from in #525 ?

  4. DiegoF90 commented on Jul 21, 2020

    @DiegoF90

    I realized that I was already using 5.3.0 but with the changes suggested in here (which I am guessing were included in 5.3.3) and matplotlib was still very slow. I then rolled back the changes and matplotlib started working as normal again. Maybe the changes have to be further reviewed so that they fix this but do not introduce this slow behaviour for matplotlib?

  5. ccordoba12 commented on Jul 21, 2020

    @ccordoba12
    Member

    @DiegoF90, thanks for confirmation. Could you let us know in what way Matplotlib is slow? I did some simple testing for PR #525 and things were working fine for me.

  6. Nowa-Ammerlaan commented on Jul 21, 2020

    @Nowa-Ammerlaan

    I have the same problem with 5.3.3, plot windows are slow, the save button is completely unresponsive. There are no issues when running the same script through any terminal directly with python. (See also the issue that @ccordoba12 mentioned above)

    Downgrading to version 5.3.2 fixed these problems

  7. ccordoba12 commented on Jul 21, 2020

    @ccordoba12
    Member

    @blink1073, one solution to this would be to exclude the control channel completely from the Qt event loop for now. That will solve the issue fixed in #525 and also this one.

    However, I don't know what implications that could have for the JupyterLab debugger. Pinging @SylvainCorlay about it.

  8. DiegoF90 commented on Jul 21, 2020

    @DiegoF90

    Hi @ccordoba12 thanks for looking into this. As @AndrewAmmerlaan mentions, the Figure window after plotting even simple graphs becomes very unresponsive. It takes longer than usual just to switch to this window. Other processes that are usually done in almost real time take second: e.g. if you activate the grid ax.grid(), the Figure window shows at the bottom left the x and y coordinates at the same time as you move around the mouse. Showing the coordinates after 5.3.3. takes around to second to update for each position.

  9. changed the title [-]Qt slow in Spyder when using ipykernel 5.3.3 (5.3.0 OK)[/-] [+]Qt slow in Spyder when using ipykernel 5.3.3 (5.3.2 OK)[/+] on Jul 22, 2020
  10. 8bit-Dude commented on Jul 22, 2020

    @8bit-Dude
    Author

    I also confirmed that the issue does not occur in version 5.3.2.

  11. raphaelquast commented on Jul 22, 2020

    @raphaelquast

    ... just to add myself to the list here...
    i can also confirm that matplotlib is very very slow after updating from 5.3.2 to 5.3.3

  12. ccordoba12 commented on Jul 22, 2020

    @ccordoba12
    Member

    Hey everyone, could you help us to test pull request #531 to see if it fixes this problem and also the warnings problem that pull request #525 tried to fix?

    We'd really appreciate your help in order to not release another faulty version. Thanks!

  13. Nowa-Ammerlaan commented on Jul 22, 2020

    @Nowa-Ammerlaan

    Hey everyone, could you help us to test pull request #531 to see if it fixes this problem and also the warnings problem that pull request #525 tried to fix?

    We'd really appreciate your help in order to not release another faulty version. Thanks!

    This patch fixes the slowness for me 😄, not sure if it fixes the original issue that #525 tried to fix, but I don't see "a flush of warnings" that that PR mentions so I guess it fixes that too.

    Thanks 👍

  14. DiegoF90 commented on Jul 22, 2020

    @DiegoF90

    Hi @ccordoba12, I think that just did the trick! I can confirm it fixes both this and #525 on my side!
    Cheers mate 👍!

  15. ccordoba12 commented on Jul 22, 2020

    @ccordoba12
    Member

    Thanks a lot @AndrewAmmerlaan and @DiegoF90 for your help!

  16. 8bit-Dude commented on Jul 23, 2020

    @8bit-Dude
    Author

    Thanks for quickly addressing the issue!

  17. raphaelquast commented on Jul 23, 2020

    @raphaelquast

    @ccordoba12 thanks for this quick fix!!! (even though it's already too late.... I can confirm that all works as expected now!)

  18. added this to the 5.4 milestone on Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions