[wxPython-users] Re: Improve performance
Robin Dunn
robin at alldunn.com
Sat Aug 19 10:54:37 PDT 2006
Franz Steinhäusler wrote:
> On Fri, 18 Aug 2006 17:31:18 -0700, Robin Dunn <robin at alldunn.com> wrote:
>
>> Franz Steinhäusler wrote:
>>> Hello, I have converted the wxWidgets Sample
>>> fractal.cpp to wxPython.
>>>
>>> My questions are:
>>>
>>> 1) the wxWidgets implementation is about 5 times faster (only estimate)
>>> How can I improve the performance?
>> Profile the app to find out exactly what is taking so long, then either
>> move that part out to a C extension module, use psyco, or etc.
>
> Hello,
> I just wondered, because at first, I suspected the random module, but it was not
> the culprit.
> I only want to try to improve it without C exentsion module or psyco.
>
> Could it be, that dc.DrawPolygon(P) and dc.DrawLine is so much slower,
> although there is only a thin wrapper about them?
> If I comment these to out, it is not much slower than the wxWidgets version.
There is some additional Python specific overhead in DrawPolygon where
it has to convert the Python sequence of values into a C array of
wxPoints, but other than that what you are seeing in general is probably
just the difference between Python and C++.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list