scripting languages vs statically compiled ones

Richard Blackwood richardblackwood at cloudthunder.com
Thu Oct 28 20:25:09 EDT 2004


beliavsky at aol.com wrote:

>Ajay <abra9823 at mail.usyd.edu.au> wrote in message news:<mailman.5578.1098897981.5135.python-list at python.org>...
>  
>
>>hi!
>>
>>is there an authoritative source on the performance of scripting languages
>>such as python vs. something like java, c, c++.
>>
>>its for a report, so it would be awesome if i could quote some well-known
>>authority on this.
>>    
>>
>
>Table 25-1, "Relative Execution Time of Programming Languages", on
>page 600 of the book "Code Complete, 2nd Edition" by Steve McConnell
>(a well-known author) has the following statistics, based on
>benchmarks described by the author in chapters 25-26. A larger number
>means the language is slower.
>
>Language       Type of Language     Execution Time Relative to C++
>C++            compiled             1
>  
>
Now since when was C++ as fast as itself?

>Visual Basic   compiled             1
>  
>
C++ and VB are both a 1?  Does this make any sense anyone?

>C#             compiled             1
>  
>
Depends on how you code it.  Though I would say the difference is only 
significant in particular cases, so I agree here.

>Java           byte code            1.5
>  
>
Read my comment below Python, but basically, this should say byte-code 
interpreted w/ Just-In-Time compilation.

>PHP            interpreted          >100
>  
>
>Python         interpreted          >100
>  
>
Is Python not bytecode interpreted?  It has no JIT with the standard 
distro but otherwise, it is no less byte-code than Java.  Misleading.

>I think Python is slower than C++ or Fortran for number-crunching,
>based on some experience with Numeric, but the speed factor is more
>often in the range of 2-10, not >100. McConnell's benchmarks are more
>general. I doubt the assertion that VB is as fast C++. Replacing a VBA
>function in Excel with a C dll can lead to big increase in speed.
>  
>
Indeed, it was my previous understanding that VB depended on runtimes.  
There are a number of internet sources which attribute relative "drag" 
to visual basic code execution.  In other words, no need to doubt the 
assertion, it is plain wrong (or so I believe from what I know).

>Table 4-1 of the same book shows the "ratio of high-level-language
>statements to
>equivalent C code" (higher is better):
>
>Language                Language Relative to C
>C                       1
>Fortran 95              2
>C++                     2.5
>  
>
>Java                    2.5
>Microsoft Visual Basic  4.5
>  
>
Higher-level than Java?  Well, you surely pay for this in language 
features and language design sensibility.

>Perl                    6
>Python                  6
>  
>
Not above Perl?  I shall have to think about this one.

>The ratios depend heavily on the type of program being written. I'll
>believe a VB/Fortran 95 ratio of 2.25 (or much higher) for Windows GUI
>programming but not for a linear algebra library, where Fortran is
>more powerful.
>  
>
Indeed.

>The sources listed for this table are the books
>
>"Estimating Software Costs", by Capers Jones, McGraw-Hill (1998)
>
>"Software Cost Estimation with Cocomo II" by Barry Boehm,
>Addison-Wesley
>(2000)
>
>and the paper (online at
>http://page.mi.fu-berlin.de/~prechelt/Biblio/jccpprt_computer2000.pdf
>)
>
>"An Empirical Comparison of Seven Programming Languages", by Lutz
>Prechelt,
>IEEE Computer, October 2000, 23-29.
>  
>




More information about the Python-list mailing list