wxPython is super slow in windows

Hello everyone,

I wrote a wx app and on windows it is super slow. I subclassed wx.App and I do a rpint in the OnInit() method and in the __init__() method and it takes several seconds to print __init__()'s after OnInit()'s was printed, on linux this is instant. I tried this on XP and Vista, does anyone know why this it's so slow? Even cvalling Show() on a frame is very slow.

Thank you, Gabriel

Hi Gabriel,

···

On Sep 2, 5:14 pm, Gabriel Rossetti <gabriel.rosse...@arimaz.com> wrote:

Hello everyone,

I wrote a wx app and on windows it is super slow. I subclassed wx.App
and I do a rpint in the OnInit() method and in the __init__() method and
it takes several seconds to print __init__()'s after OnInit()'s was
printed, on linux this is instant. I tried this on XP and Vista, does
anyone know why this it's so slow? Even cvalling Show() on a frame is
very slow.

Thank you, Gabriel

I've never seen this behavior on Windows. Can you tell provide a small
runnable sample (see MakingSampleApps - wxPyWiki)? Which
wxPython and Python versions are we talking about?

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Mike Driscoll wrote:

Hi Gabriel,

Hello everyone,

I wrote a wx app and on windows it is super slow. I subclassed wx.App
and I do a rpint in the OnInit() method and in the __init__() method and
it takes several seconds to print __init__()'s after OnInit()'s was
printed, on linux this is instant. I tried this on XP and Vista, does
anyone know why this it's so slow? Even cvalling Show() on a frame is
very slow.

Thank you, Gabriel
    
I've never seen this behavior on Windows. Can you tell provide a small
runnable sample (see MakingSampleApps - wxPyWiki)? Which
wxPython and Python versions are we talking about?

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Hello Mike,

I'm currently investigating deep in my code, it may be due to wx running in a
seperate thread and my using PyPubSub to communicate from it ans to it. I'd
like to look some more first now that I got this idea and if it's not that then I'll
post a small example.

Thanks, Gabriel

···

On Sep 2, 5:14 pm, Gabriel Rossetti <gabriel.rosse...@arimaz.com> > wrote:

Gabriel Rossetti wrote:

Hello everyone,

I wrote a wx app and on windows it is super slow. I subclassed wx.App and I do a rpint in the OnInit() method and in the __init__() method and it takes several seconds to print __init__()'s after OnInit()'s was printed, on linux this is instant. I tried this on XP and Vista, does anyone know why this it's so slow? Even cvalling Show() on a frame is very slow.

Are you doing anything out of the ordinary? Does the wxPython demo or PyCrust behave this way too? Do you have any EVT_PAINT handlers that do not create a wx.PaintDC for the window that received the event? (This causes a weird side-effect on Windows that can manifest in *very* slow or totally blocked apps.)

···

--
Robin Dunn
Software Craftsman

Robin Dunn wrote:

Gabriel Rossetti wrote:
  

Hello everyone,

I wrote a wx app and on windows it is super slow. I subclassed wx.App and I do a rpint in the OnInit() method and in the __init__() method and it takes several seconds to print __init__()'s after OnInit()'s was printed, on linux this is instant. I tried this on XP and Vista, does anyone know why this it's so slow? Even cvalling Show() on a frame is very slow.
    
Are you doing anything out of the ordinary? Does the wxPython demo or PyCrust behave this way too? Do you have any EVT_PAINT handlers that do not create a wx.PaintDC for the window that received the event? (This causes a weird side-effect on Windows that can manifest in *very* slow or totally blocked apps.)

Hello Robin,

Like I told Mike I use PyPubSub to communicate with my GUI (and in between the different frames too). The wx main loop is
actually running in a thread because I have another mainloop running in the main thread (Twisted's reactor). I use wx.CallLater
to make the pub.sendMessage calls. I do not have any EVT_PAINT handlers nor do I use wx.PaintDC.

Thanks,
Gabriel