Is python really slow?

Bjorn Pettersen BPettersen at NAREX.com
Tue May 21 21:12:19 EDT 2002


> From: Chris [mailto:chrisl_ak at hotmail.com] 
> 
> I spend a fair amount of time on perl newsgroups, having the 
> need to use 
> perl for various parts of my job. I am now learning Python. I 
> am a bit 
> disheartened at how common it seems to code only some of a program in 
> Python and use C for other parts, and how much discussion 
> here involves 
> using C for X and Y. I don't have time to learn another 
> language. I don't 
> see nearly as much discussion about doing this in the Perl newgroups. 
> Should I just be learning C instead? Is this just because of 
> the different 
> applications python is being put to use for or because Python 
> programmers 
> are more "multi-lingual" or is Python really so slow that one 
> needs to go 
> to C on a more regular basis?

Python is not slow at all. There are however tasks that you would not
normally do in a scripting language (heavy number crunching etc.). One
of the good things about Python is that you can still write those types
of applications in Python and only write the performance critical parts
in C/C++ versus writing the entire application in C/C++.

Many of us also have to deal with large libraries of pre-existing C/C++
libraries that we can't afford to rewrite in Python. Since it is almost
trivial to wrap these libraries as Python extension modules it lets us
have the best of two worlds.

I'm not a Perl expert, but from what I hear it is considerably harder to
extend/embed Perl (someone please correct me if I'm wrong <wink>).

-- bjorn





More information about the Python-list mailing list