Speed with Python

Ken Seehof kens at sightreader.com
Wed Jun 28 10:59:43 EDT 2000


Moshe Zadka wrote:

> On 27 Jun 2000, [ISO-8859-1] François Pinard wrote:
>
> > [Ken Seehof]
> >
> > > I do all GUI work in python (wxPython) and I have not noticed a difference
> > > in speed as compared to C++, probably because most time is spent in
> > > library calls anyway.
> >
> > I experimented some GUI writing in Python, and initially expected that things
> > would be slow.  Not at all: I was very pleasantly surprised by the speed.
>
> Indeed: in most GUIs, most time is spent in the user's head: IOW, the
> computer is too fast, and most time it is just sitting quietly, waiting
> for the user to make up his mind. Python's idle loop is almost as good
> as C++'s <wink>

> --
> Moshe Zadka <moshez at math.huji.ac.il>
> http://www.oreilly.com/news/prescod_0300.html
> http://www.linux.org.il -- we put the penguin in .com

On the contrary!  Python's idle loop is slightly more effective than C++'s. The
purpose of an idle loop is to be idle right?   Python's idle loop is slightly
slower and therefore more idle.  :-)  Kinda like in California where stop lights
are more effective.

Actually, in my case, I'm writing a graphical editor, so dragging objects around
and drawing lines as the mouse moves must be done as smoothly as possible.  For
extra smoothness, I'm using a double backplane to eliminate flicker and minimize
the amount of drawing work.  I probably wouldn't have bothered doing that if I had
been using C++.  The final result is much smoother than most C++ programs.

Conclusion: Given the same amount of development time, a python GUI is likely to
appear faster and smoother than the equivalent C++ GUI because the python
programmer has enough time to be clever.

--
Ken Seehof
kens at sightreader.com
starship.python.net/crew/seehof
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!






More information about the Python-list mailing list