[PyKDE] Speeding up PyKDE small app
Jim Bublitz
jbublitz at nwinternet.com
Thu Apr 28 08:43:13 BST 2005
On Wednesday 27 April 2005 17:26, Matej Cepl wrote:
> I am very much newbie in Qt/KDE programming, but I needed for a vim-script
> I work on slightly more complicated than what I could get with vim-script
> or with kdialog. After not getting any answer for my (probably quite naive)
> question how to do it in PyKDE, I gave up, downloaded Qt-designer, learned
> a little bit about PyQt and created the attached script. It is basically
> what I want, but there is only one problem. It is very slow, waiting for
> the dialog for couple of seconds is just not acceptable (I have here
> Pentium III, 450 MHz, with 256 MB RAM). Of course, translation of the
> script into C++ and compilation would help, but I cannot (and will not)
> learn C++ to do it, and I would love to keep whole system maintainable for
> me.
> Could anybody help me to find, whether I am doing so stupid, that it makes
> whole script slow, or just PyKDE is not good for this kind of scripts and I
> should try something else? What?
It's a PyQt app - if it were a PyKDE app it would probably load even slower :(
It runs very quickly here on a 1.6GHz/1GB machine. I don't notice anything
that would make it especially slow. Maybe using fixed geometries instead of
layouts and omitting the PNG might speed things up, but I doubt they'd make
much difference.
Most likely it's either system speed (processor/HD/memory bus) or amount of
RAM. Your dialog takes up a little over 3MB according to free, so memory
doesn't seem likely, but it opens a number of files.
Short of doing something like preloading the dialog (and perhaps keeping it
hidden) I don't think coding is going to speed up the load time very much.
You could look at doing something in Python/Tcl - I'm not sure if that's much
faster, as I suspect some of the load time is due to Python itself starting
up and loading modules.
Jim
More information about the PyQt
mailing list