Still on python GUI toolkit

Fredrik Lundh fredrik at pythonware.com
Wed Nov 21 13:45:58 EST 2001


Tyler Eaves wrote:
>
> > The application I tested is a pixel-intensive type of application because
> > it is the most challenging of the tools I will need: it displays
> > continuously an 80x80 syntetic image randomly generated with 256
> > graytones, by using small filled squares for each pixel
>
> Unless you used Tkinter's canvas widget, this wasn't a fair test.

if he *did* use the canvas widget, it wasn't a fair test.

the Tkinter canvas is optimized for applications that create
a model once, and then make relatively minor modifications
to it (e.g. graphics editors).

if you have data that changes rapidly, you'll likely to spend
more time tranferring data between Python and the canvas
model than you spend on updating the screen.

better use a data display widget (try searching google for
"custom Tk widgets"), or use something like Tkinter 3000's
WCK:

http://www.pythonware.com/products/tkinter/tkinter3000.htm

as an example, here are timings for Gordon Williams' oscillo-
scope benchmark (search the archives for source code; the
Tkinter 3000 version is available in the WCK source kit):

- Python 1.5.2, Tkinter Canvas: 2.3 frames/second
- Python 2.0, Tkinter Canvas: 12 fps
- Python 2.0, Tkinter 3000 w. Tk driver: 500 fps
- Python 2.0, Tkinter 3000, native Win32 driver: 800 fps

(benchmarked on an old 200 MHz PC running W2K)

</F>






More information about the Python-list mailing list