[PyQt] PyKDE dcopext string marshalling;
no unicode chars in a QString?
Danny Pansters
danny at ricin.com
Mon Apr 30 21:29:51 BST 2007
On Monday 30 April 2007 21:35:57 Hans-Peter Jansen wrote:
> Am Montag, 30. April 2007 16:22 schrieb Danny Pansters:
> > The code that does the video capturing is written in C and used in the
> > rest of the app as a python module (using SWIG to expose a dozen simple
> > control functions).
>
> You may want to do yourself a favour and wrap that stuff with sip. That's
> exactly the kind of tasks, sip was invented for. Sure, swig isn't bad, but
> sip will create a single importable .so in less time, without any auxiliary
> python wrapper modules with better load time and run time performance.
>
Because sip is more complicated (as in overkill). I use basic types and simple
C code. They do things like ioctls and SDL display. The way it is now I can
have the swig directives in my normal header file so that foo.h and foo.c are
basically all I need/have (well three times for manipulating three hardware
drivers). I like to avoid any extra complexity as much as possible.
I can't verify your claims about speed and load time. I think they're broad
and generalizing. I'm not having performance issues. If I would I'd move the
offending code from Python to C (or consider pyrex). Compared to the GUI it's
speedy enough. Besides, working with hardware, such as i2c devices for
tuners, I can tell you that some operations are just dog slow by nature. A
little python layer more or less between it won't even matter. I think in
general you (well, I) can improve performance a lot more by making the GUI
code more efficient. And of course by byte compiling all py modules.
It's my understanding that sip was invented to primarily wrap C++ and
especially TrollTech's C++.
Anyway, this is OT... but interesting nonetheless.
Dan
More information about the PyQt
mailing list