[wxPython] wxPython, slowness, and Novell fileservers

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] wxPython, slowness, and Novell fileservers

Roger Young-3
Hi,

I work at a university and have been experimenting with writing
wxPython programs to help students learn logic and philosophy of
science. I have released the first program to students, but it has
been a disaster because the program runs ridiculously
slowly across our network in the university's public labs, even
though it will run well within our own subnet or on a stand alone PC.
Some of the workstations in the public labs are more powerful and
have more memory than the best machines in my own department (400 Mhz
and 128 megabyte against 266 Mhz and 64 megabyte). Moreover the
program will run acceptably in our own subnet on machines which are
200Mhz Pentium 1s with 32 megabytes and a 10 megabit ethernet card.

I am mailing your list to try to find out whether there are
important factors that I have failed to understand about wxPython (or
Python itself), when it is loaded from a Novell fileserver
across a network to run on a WindowNT workstation.

My program is run by running python.exe with the name of my script as
a command line argument.  My program uses wxSplitterWindow and
wxHtmlWindow. For the most part pages are set rather than loaded from
file, because html is created on the fly. A few logical connectives
are pictured on screen using quite small bitmap files (less than
200k). Listboxes and buttons are embedded in the html. The program
uses events failrly extensively. In the network environment, python
and wxPython are being loaded from my department's  fileserver and
relevant keys are written into the registry when they are loaded. Of
course, I could have made a mistake in these keys, but any such
mistake ought to manifest itself on our subnet.

I have used other languages (for example, Prolog) very satisfactorily
in the public labs in previous years, and these were loaded from our
fileserver.  It could be that my problem is simply that a new
bottleneck has developed between our subnet and the public labs, or
that  the network has become overloaded since I last used it for
classes in the Public labs. An obvious factor is that, like other
departments, my department communicates with the wider network
through a router with 10 megabit ports. Our own subnet is capable of
100 megabits, and the server has a switch.  However. within our own
subnet, I have tested the program on an older machine with a 10
megabit card in it.  Thus I know the 10 megabits constraint is not
itself a problem. Of course, demand from many users for the same 10
megabit port could be the problem, but then one would expect the
problem to correlate with periods of high network demand.  It does
not seem to do so.  Moreover, the university technicians claim there
is no problem `at their end' , and staff users from our subnet have
not been experiencing any obvous problems in accessing the wider
network..

Perhaps a relevant factor is that student users do not have
permission to write to the workstation's  hard disk in the public
labs, whereas users do within our own subnet.

Have users of this list any suggestions about the performance that
they  would expect from wxPython in the circumstances I have
described (I can go into more detail if necessary)? Are there any
obvious causes of my problem that users can identify?

Yours,
Roger Young


 .





Roger Young,
Philosophy Department,
University of Dundee
[hidden email]
tel 01382 344539

_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] wxPython, slowness, and Novell fileservers

Robin Dunn
> I work at a university and have been experimenting with writing
> wxPython programs to help students learn logic and philosophy of
> science. I have released the first program to students, but it has
> been a disaster because the program runs ridiculously
> slowly across our network in the university's public labs, even
> though it will run well within our own subnet or on a stand alone PC.
> Some of the workstations in the public labs are more powerful and
> have more memory than the best machines in my own department (400 Mhz
> and 128 megabyte against 266 Mhz and 64 megabyte). Moreover the
> program will run acceptably in our own subnet on machines which are
> 200Mhz Pentium 1s with 32 megabytes and a 10 megabit ethernet card.
>

It sounds to me like a network bottleneck that is being manifested by a
program that has to access the disk a fair amount.  Durring initialization
and program startup Python can be fairly disk intensive.  Every time there is
an import statement, upto all the directories on the python path can be
searched multiple times (for .pyc, .py, .pyd, .dll, etc.)  If your program
itself does not access the disk much, then you can probably get a large
improvement by using Gordon McMillan's installer program.
(http://starship.python.net/crew/gmcm/install.html)  It will bundle up
compiled versions of all the .py files used by your program into a single
file so it will greatly reduce the amount of disk access due to imports.


--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

RE: [wxPython] wxPython, slowness, and Novell fileservers

Chris Davs
In reply to this post by Roger Young-3
While I don't fully understand you former problem, I have a suggestion for
your latter problem.  You might try using GIFs instead of BMPs to speed up
your connection to the server.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]]On Behalf Of Roger Alan
Young
Sent: Monday, February 21, 2000 4:13 PM
To: Robin Dunn
Cc: Roger Young; [hidden email]
Subject: Re: [wxPython] wxPython, slowness, and Novell fileservers


I appreciate the fast response to what I wrote, and the advice below
is very reasonable, so much so that I'd already tried it by the time I got
the reply. Unfortunately, it did not solve my problem, as I
report below.

Robin Dunn writes:

 > It sounds to me like a network bottleneck that is being manifested by a
 > program that has to access the disk a fair amount.  During initialization
 > and program startup Python can be fairly disk intensive.  Every time
there is
 > an import statement, upto all the directories on the python path can be
 > searched multiple times (for .pyc, .py, .pyd, .dll, etc.)  If your
program
 > itself does not access the disk much, then you can probably get a large
 > improvement by using Gordon McMillan's installer program.
 > (http://starship.python.net/crew/gmcm/install.html)  It will bundle up
 > compiled versions of all the .py files used by your program into a single
 > file so it will greatly reduce the amount of disk access due to imports.
 >

The problem that I run into with this idea is that, because I have embedded
modules in my Html (for listboxes and a button panel), my module
of python code needs to be loaded in any case. So, I do get some
speed up by having a .exe file to run at the start, but I still have
to have my python module available to be loaded again and again to
support the Html (at least, this is how I understand what is happening
at the moment).Maybe I can improve things a bit by making sure that
python module that gets loaded contains only the minimal code
necessary to support the embedding.

Another problem is that I have used small bitmaps for my logic
symbols, because, so far as I can make out, I cannot specify the
fonts that I need to represent the symbols as characters. This
necessitates access to the server.

All this is a pity, because I find python and the GUI that you have
provided, fun to program in and I was hoping to develop more logic
teaching applications in this medium.

Yours,
Roger Young

_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] wxPython, slowness, and Novell fileservers

Robin Dunn
In reply to this post by Robin Dunn
> I appreciate the fast response to what I wrote, and the advice below
> is very reasonable, so much so that I'd already tried it by the time I got
> the reply. Unfortunately, it did not solve my problem, as I
> report below.
>
> Robin Dunn writes:
>
>  > It sounds to me like a network bottleneck that is being manifested by a
>  > program that has to access the disk a fair amount.  During
initialization
>  > and program startup Python can be fairly disk intensive.  Every time
there is
>  > an import statement, upto all the directories on the python path can be
>  > searched multiple times (for .pyc, .py, .pyd, .dll, etc.)  If your
program
>  > itself does not access the disk much, then you can probably get a large
>  > improvement by using Gordon McMillan's installer program.
>  > (http://starship.python.net/crew/gmcm/install.html)  It will bundle up
>  > compiled versions of all the .py files used by your program into a
single

>  > file so it will greatly reduce the amount of disk access due to imports.
>  >
>
> The problem that I run into with this idea is that, because I have embedded
> modules in my Html (for listboxes and a button panel), my module
> of python code needs to be loaded in any case. So, I do get some
> speed up by having a .exe file to run at the start, but I still have
> to have my python module available to be loaded again and again to
> support the Html (at least, this is how I understand what is happening
> at the moment).Maybe I can improve things a bit by making sure that
> python module that gets loaded contains only the minimal code
> necessary to support the embedding.

You can explicitly specify that these module should get put into the archive
file produced by the Installer since it won't detect the dynamic imports that
are being done.  This the modules are in the archive then that will help...



> Another problem is that I have used small bitmaps for my logic
> symbols, because, so far as I can make out, I cannot specify the
> fonts that I need to represent the symbols as characters. This
> necessitates access to the server.
>

I havn't yet tackled being able to load bitmaps from an archive, but I hope
to be able to do that someday.  Another option you might look at was posted
here on the list a couple weeks back.  It involved embedding images into a
DLL and loading them as a python extension  module.


--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] wxPython, slowness, and Novell fileservers

Joel Lucsy-2
In reply to this post by Chris Davs
Or better yet, directly embed the bitmap into the Python script. I remember
someone came up with a way to create a bitmap directly from the data.
Another approach is to write out a temporary file from the data. I've used
zlib and base64 to accomplish this. I compressed the data, then base64'd it
to easily embed into the script.

 - Joel Lucsy ([hidden email])

----- Original Message -----
From: "chris davis" <[hidden email]>
To: "Roger Alan Young" <[hidden email] (Roger Alan Young)>
Cc: <[hidden email]>
Sent: Monday, February 21, 2000 5:39 PM
Subject: RE: [wxPython] wxPython, slowness, and Novell fileservers


> While I don't fully understand you former problem, I have a suggestion for
> your latter problem.  You might try using GIFs instead of BMPs to speed up
> your connection to the server.

<SNIP>



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] wxPython, slowness, and Novell fileservers

Kevin Jacobs
On Mon, 21 Feb 2000, Joel Lucsy wrote:
> Or better yet, directly embed the bitmap into the Python script. I remember
> someone came up with a way to create a bitmap directly from the data.
> Another approach is to write out a temporary file from the data. I've used
> zlib and base64 to accomplish this. I compressed the data, then base64'd it
> to easily embed into the script.

I think the problem is that the HTML control does not cache bitmaps so it
loads them from file every time they are placed.  This should be fairly easy
to fix, though possibly not in native Python.  Once they are cached,
performance should be quite adequate.

-Kevin

--
----------->  Kevin Jacobs  <-----------|------->  (216) 778-8487  <--------
S.A.G.E. Project Technical Coordinator  | Department of Epidemiology
  & System Administrator                |   & Biostatistics
Internet E-mail: [hidden email] | Case Western Reserve University
----------------------------------------------------------------------------



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] wxPython, slowness, and Novell fileservers

Piet van Oostrum
In reply to this post by Roger Young-3
One thing you have to check is that the .py files on the server machine
have been byte compiled, i.e. that for each .py file there is a .pyc file.
This has to be done by the person who owns the .py files, or at least has
write permission to the directories. For wxpython an easy way to get this
working is to run the demo. For your own program run it on the server or
with write permission on the server.
--
Piet van Oostrum <[hidden email]>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: [hidden email]


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users