Python Speed Question and Opinion

Mark J. Nenadov mark at freelance-developer.com
Fri Jun 4 23:40:03 EDT 2004


On Fri, 04 Jun 2004 17:14:44 -0700, Maboroshi wrote:

> Hi I am fairly new to programming but not as such that I am a total beginner
> 
> From what I understand C and C++ are faster languages than Python. Is this
> because of Pythons ability to operate on almost any operating system? Or is
> there many other reasons why?
> I understand there is ansi/iso C and C++ and that ANSI/ISO Code will work on
> any system
> 
> If this is the reason why, than why don't developers create specific Python
> Distrubutions for there operating system.
> 
> Please don't take this the wrong way I am totally one for standards. I am
> just looking at these forums and there is a lot of stuff about Python and it
> inability to match C or C++
> 
> Also from what I understand there are Interpreted and Compiled languages
> with Interpreted languages memory is used at runtime and Compiled languages
> the program is stored in memory.
> 
> Or is this wrong?
> 
> Python is an Interpreted Language, am I right? than wouldn't it be possible
> if there was OS specific Python distrubutions, that you could make Python a
> Compiled language
> 
> Or is this completely wrong?
> 
> Thanks if you answer my questions
> 
> Bye For Now

Generally speaking, you will find C and C++ to be the fastest languages.
Implementations of C/C++ are generally much faster than anything else
(whether it be Python, Java, Perl, etc.) I don't think the speed
difference is because of portability. Python is interpreted, but not
completely. It deals with compiled byte-code in a way *roughly* similar to
Java.

Personally, I think people often get bent out of shape about speed for no
good reason. I'm not saying speed does not matter, it matters very much in
SOME situations. But people will discard a language just because it
performs a benchmark in 0.005 seconds, whereas C can do it in 0.00002
seconds. To me that is unintelligent. You need to evaluate a language
implementation in all categories, not just bench-marked runtime speed

Scenario A: A person chose to do a project in pure C because C is faster.
However, they didn't have a good understand of C, and as a result their
algorithm implementations were sloppy.

Scenario B: A person chose Python for a project. They realized the Python
implementation may be slower than the C implementation, but since their
algorithm implementations were much clearer in a high-level language, they
ended up having an easier time optimizing and actually ended up with
better performance results.

While speed is important and C implementations will usually be faster, we
need to remember that there are many other factors to consider. In my
opinion, things like programmer productivity and simplicity of
implementation are usually more valuable than raw runtime performance. I 
think that there are not many languages that can match Python in terms of
programmer productivity and simplicity.

--
Mark J. Nenadov
Python Byte Solutions
http://www.pythonbyte.com




More information about the Python-list mailing list