[Mailman-Developers] module imports & performance

Thomas Wouters thomas@xs4all.net
Sat, 14 Jul 2001 17:27:48 +0200

On Sat, Jul 14, 2001 at 05:08:21PM +0200, Ricardo F . Kustner wrote:

[ Ricardo reinstalls ]

> Most of the components (apache,fastcgi,php and some perl scripts) don't show
> any difference in performance, but it looks like the mailman python scripts
> have decreased in performance dramatically... loading up a page in the
> webinterface takes about 7 seconds! After some playing around with python
> -i, I noticed that "from Mailman import MailList" takes about 4 seconds...
> Does anybody have any idea what's going on? maybe the python binary compiled
> into Debian isn't optimized enough for my system or could this be a problem
> in mailman? 

Well, 'import MailList' triggers a lot of file loads, so the easiest target
would be 'disk I/O'. But just to be sure: all your modules have '.pyc'
variants as well ? You can check by doing something like

bash-2.04$ cd /usr/local/mailman
bash-2.04$ python
Python 2.0 (#8, Mar  1 2001, 13:20:58) 
[GCC 2.95.2 19991024 (release)] on freebsd4
Type "copyright", "credits" or "license" for more information.
>>> from Mailman import MailList
>>> print MailList.__file__

If the latter says '.py' instead of '.pyc', that's your problem. The 'from
Mailman import MailList' took only a faction of a second on that machine, by
the way, but it's pretty high-end (1Ghz P3, 1Gb RAM, U160-SCSI, FreeBSD) so
that isn't too suprising.

If that isn't the problem, your best bet is to keep an eye on the system.
'iostat' (need to install it separately on Linux, I think) and 'vmstat' can
deliver a lot of useful info about why a task is taking so long. 

Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!