[python-win32] Fastest GDI loop
Tim Roberts
timr at probo.com
Wed Feb 6 22:48:46 CET 2008
Gerdus van Zyl wrote:
> Please find attached my program (please excuse the mess) that uses
> cairographics.org to draw on a win32 window using GDI. My question is:
> What is the best event handling/drawing loop that one can have in
> pywin32? Is for instance a message map faster or slower? I am new to
> the win32 api and don't know what is the best way to do things.
>
The "best" one is the one that makes sense to you -- the one you can
maintain in the future. The overhead of running Python (as opposed to
C++) is going to swamp any difference in performance between various
techniques of handling the message loop. That's true of user interfaces
in general; the typical user interface application spends 99.9% of its
time waiting for the next message.
I'm a Python advocate, but if you need to squeeze every microsecond out
of your drawing code, then you probably shouldn't be writing it in Python.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list