Python Performance vs. C++ in a Complex System

Andrew MacIntyre andymac at bullseye.apana.org.au
Sat Apr 21 22:16:16 EDT 2001


On Sat, 21 Apr 2001, Gabriel Ambuehl wrote:

> This is very interesting. I've got to implement a server resource
> monitoring system and had a shot at it in my beloved Python. While
> Python's threading obviously works (something I can't really say about
> C++ as it appears to be not very well thought the whole stuff),
> I found it to be very slow.

{...}

> [2] Python did some two hundred concurrent threads with about 30 MB
> RAM usage on FreeBSD which would be very nice if I could only get
> CPU utilization way down.

I realise that having threads involved complicates matters considerably,
but as you don't mention having profiled your Python version to conclude
that httplib is your bottleneck, I keep thinking of the TimBot's axiom
(amplified by personal experience) that bottlenecks aren't usually where
you think they are.  If you haven't already attempted profiling your
Python code, it would be worth a try, and might save you considerable
effort on C code (even if it points to code that should be in C).

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andrew.macintyre at aba.gov.au    (work) | Snail: PO Box 370
        andymac at bullseye.apana.org.au  (play) |        Belconnen  ACT  2616
        andymac at pcug.org.au           (play2) |        Australia





More information about the Python-list mailing list