Is python really slow?

Mark McEahern marklists at mceahern.com
Tue May 21 21:15:36 EDT 2002


[Chris]
> 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?

What draws me to Python is:

  1.  The pragmatic approach it encourages.
  2.  The multi-paradigmatic approach it encourages (it's not just OO, it's
not just functional, it's not just procedural).
  3.  The clarity it makes possible.
  4.  Batteries are included (the standard library has lots to offer).

I've been using Python for almost a year and haven't felt the need to write
a C extension.  Well, that's partially true.  A colleague of mine wrote one
(to interface with Verisign's PayFlowPro SDK) and I fixed a tiny bug in it.
I wouldn't expect Verisign to provide a native Python API, so in this case
the fact that Python allows for C extensions is an expression, again, of its
pragmatic nature.  In this case, the need for the C extension had nothing to
do with speed, but rather with utilizing a third party library.

I'd say if you find another language that suits your needs better than
Python, by all means that should be where you spend your energy.

Cheers,

// mark






More information about the Python-list mailing list