"hello world" type program from wxPython tutorial takes 6
seconds to start on my cel 366 128mb system (running Debian). Is
this typical? Why is it so slow? I'm looking for a graphic
toolkit that'd be fairly quick. I don't want to use Tk because of
the looks.
- Andrei
--
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: cy.silmarill.org
How fast do you need it to be? (That's a serious question.
Are you planning to open and close the application so frequently
that six seconds is unacceptable?)
On my blazing 233 MHz Windows 98 machine, with Python 2.2.1
and WxPython 2.3.2.1, a hello world program I just wrote
runs in about two seconds, for what it's worth.
-Peter
>
> On my blazing 233 MHz Windows 98 machine, with Python 2.2.1
> and WxPython 2.3.2.1, a hello world program I just wrote
> runs in about two seconds, for what it's worth.
>
> -Peter
Odd.. if not too much trouble, could you please try this one
(from wxpython tutorial)?
from wxPython.wx import *
class MyApp(wxApp):
def OnInit(self):
frame = wxFrame(NULL, -1, "Hello from wxPython")
frame.Show(true)
self.SetTopWindow(frame)
return true
app = MyApp(0)
app.MainLoop()
First time running: 4 seconds.
Subsequent invocations: 2 seconds.
-Peter
i changed this to "return false"
> app = MyApp(0)
> app.MainLoop()
(2nd time, P3-600 Win32)
$ time python news_wxspeedtest.py
OnInit returned FALSE, exiting...
...
real 0m1.382s
user 0m0.020s
sys 0m0.030s
here the slowest part is loading and initilaizing the interpreter.
i think wx windows slows loading down, especialy the first time, because
its loading the wx library. on win32 this is about 4MB.
chris
--
Chris <clie...@gmx.net>
From a human interface perspective, having to wait six seconds for a
response to a command (including "start program") is annoying; this is
the reason for "splash screens". You don't want people to be annoyed
every time they start your program.
Worse, six seconds is plenty of time for a user's thoughts to wander;
it means that the user may have forgotten what they wanted to do by
the time the program starts.
I realize that. That's why I was directing the discussion towards
alternatives, such as splash screens... :-)
Other options might include making sure modules are not loaded
until they are needed, or loading them on a separate thread just
after the main program starts.
None of which seems to help the OP. I'm curious why the Linux
implementation is so much slower than the Win32. My own machine
is _not_ fast! (It's only a 233 MHz Pentium MMX.)
-Peter
Convincing your users that they need to preload the libs might
work too -- for instance by creating a 'server' component that
should be started when the machine is booted that loads the lib.
> None of which seems to help the OP. I'm curious why the Linux
> implementation is so much slower than the Win32. My own machine
> is _not_ fast! (It's only a 233 MHz Pentium MMX.)
>
wxPython has to load gtk, probably, and the bindings. The underlying
gui library is already present in memory on a windows machine, leaving
only the bindings to be loaded.
I've also noticed that Python loads its own bytecode files rather
more slowly than other files. So any pixmaps shouldn't be put in the
code, but loaded separately. That can make quite a difference.
--
Boudewijn Rempt | http://www.valdyas.org
| "hello world" type program from wxPython tutorial takes 6
| seconds to start on my cel 366 128mb system (running Debian). Is
| this typical? Why is it so slow? I'm looking for a graphic
| toolkit that'd be fairly quick. I don't want to use Tk because of
| the looks.
I had the same problem which appeared when I used py2exe.
The generated exe just neads one second instead of four...
Greetings, Uwe.
--
Dr. rer. nat. Uwe Schmitt ICQ# 159647634 Uwe.S...@num.uni-sb.de
I was using wxPython for a while. The main advantage being that it was
going to be cross platform, however I found its speed too slow. (Not startup
speed, which is fairly irrelevant to me, but just general responsiveness.)
I'm not sure if this was just wxWindows itself or the python bindings.
I have started using pygtk <http://www.daa.com.au/~james/pygtk/> (easily
apt-getable). The only problem I've had with this is the lack of docs.
http://www.moeraki.com/pygtktutorial/gtk-tut.html, seems to be the best
available, followed by reading the source.
Cheers,
Benno
>
> I've also noticed that Python loads its own bytecode files rather
> more slowly than other files. So any pixmaps shouldn't be put in the
> code, but loaded separately. That can make quite a difference.
>
--
Thanks, I think that's exactly what I'm gonna have to do.
I found wxPython to be slow also. I wrote a program to syntax
highlight a specific type of log file with Tkinter. I thought wxPython
would look better and it has more controls available so I ported it
to wxPython. The performance was so bad I went back to Tkinter.
For example, loading a 1MB file into the text box and syntax highlighting
it in Tkinter takes about 2 seconds. In wxPython it took more than
30 seconds.
Patrick M.
Hi,
try pygtk. I also switched to it, after i found wxPython too slow for my
PPro-200.
http://www.daa.com.au/~james/pygtk/
Mario
This whole thread is somewhat strange.... one of the things I liked about
wxWindows was that it seemed like one of the snappier cross plateform
libraries I've worked with. I'm on a relatively fast machine (1 Ghz with 512M)
with Windows (which has been mentioned here as having a faster start).
The first start up has touch of delay (less than most commercial apps), but
after that it's instant.
I guess it's hard to really remember just how much faster computers have
gotten over time.
--
Don Garrett http://www.bgb.cc/garrett/
BGB Consulting gar...@bgb.cc
I agree. Some people are mistaking "hello world" with typical
applications and startup time with performance ;-)
Gerhard
--
This sig powered by Python!
Außentemperatur in München: 12.1 °C Wind: 2.7 m/s