Did wx get MUCH slower between 2.4 and 2.6+?

In the old version of the code, these operations were virtually
instantaneous; with the new version, you can actually watch the
individual controls change, and it can take several seconds (!)
to reload them all. I've tried adding .Freeze() and .Thaw()
calls in the hope that this would make it faster, but this only
makes the change appear to hesitate for the same interval, and
then update all at once. The lag is so noticeable that I feel
like there ought to be wait cursor, but I can't help but feel that
loading up 20-40 controls with values *should NOT* take this
long! (and didn't before...)

I don't remember noticing a slowdown of that magnitude, or really any
slowdown at all. Are you sure it is wxPython? Perhaps it could be some
portion of your application that is doing some operation that is taking
a long time to execute.

I've converted to the "new" paradigm of wx. syntax, but I would
have thought that would make things faster, not slower...
Is there something I should be doing that I'm missing that
once again makes such an update lightning fast, or is 2.6+
just a LOT slower than before?

It's a particular kind of tradeoff, but technically speaking, wx.foo
will be slower to access than wxfoo, but you should really only notice
it if you are doing tens of thousands of attribute lookups. Also, you
save the time of doing a curmodule.__dict__.update(wxmodule.__dict__)
when using plain 'import wx'.

In any case, below you will find a small program that enters values into
text controls. On my machine, the entries update themselves almost
instantly.

- Josiah

import itertools
import wx

cnt = itertools.count()

class myp(wx.Panel):
    def __init__(self, parent):
        wx.Panel.__init__(self, parent)
        sz = wx.BoxSizer(wx.VERTICAL)
        self.btn = btn = wx.Button(self, -1, "click me")
        btn.Bind(wx.EVT_BUTTON, self.OnClick)
        sz.Add(btn, 0, wx.ALL, 3)
        self.tcs =
        for i in xrange(20):
            tc = wx.TextCtrl(self)
            sz.Add(tc, 0, wx.EXPAND|wx.ALL, 3)
            self.tcs.append(tc)
        self.SetSizer(sz)
    def OnClick(self, evt):
        for i in self.tcs:
            i.SetValue(str(cnt.next()))

if __name__ == '__main__':
    a = wx.App(0)
    b = wx.Frame(None, title="entry test")
    c = myp(b)
    b.Show(1)
    a.MainLoop()

ยทยทยท

Will Sadkin <WSadkin@Parlancecorp.com> wrote: