Tkinter performance

David Ascher da at ski.org
Mon Apr 19 12:24:30 EDT 1999


On Mon, 19 Apr 1999, Greg Landrum wrote:

> While I'm at it, I have a performance question about Tkinter.
> 
> I am thinking about doing a python/Tkinter port of a program
> which currently uses C/Xlib (or C/quickdraw on the Mac). I'd
> love to get this to work because then I would (finally) have
> a version which could work under Win95/98/NT.  But I'm worried
> about performance issues.
> 
> The program does 3D graphics (molecular/crystal visualization
> and orbital plots).  I handle all of the perspective/transformation
> stuff myself, so I don't need any 3D functionality.  I do need
> something which can draw reasonably quickly however.
> 
> Suppose I need to draw a couple hundred circles and several
> thousand line segments (these are mostly connected, so I can
> use things like XDrawLines to cut down function calls) at
> every update.  
> 1) Can Tkinter on a "typical" PC (say a P200) deliver a 
> "reasonable" update rate (a couple of frames per second 
> would probably cut it)? 
> 2) Is there anyway to do double-buffering to avoid flashing
> during redraws?
> 
> I am guessing that the answer to both of these of these questions
> is "No", but I'd love to hear a contrary opinion.

I'd suggest using PyOpenGL with the NumPy extension.  In combination, it
can be quite fast, by pushing the loops to C extension modules.  The only
portability problem is to the mac -- there is no Togl widget for the mac
yet.

   http://starship.python.net/~da/PyOpenGL

--david ascher







More information about the Python-list mailing list