Aug 022011
 

I hear debates about the speed of languages all the time. Most people who argue for low-level compiled languages cite that anything can be faster with optimized C. True, but if we put in around the same effort in coding, higher level languages can offer better optimization. Java doesn’t have direct pointer access, and so can offer better compiler and runtime optimization than compiled C/++ in some cases, since the JVM has more control over your memory usage.

This, though, takes the cake: http://morepypy.blogspot.com/2011/08/pypy-is-faster-than-c-again-string.html

 

In general Python, as a dynamically typed language, and PyPy is one of the fastest JIT compilers for Python out there. Even so, Python is generally much slower than an equivalent program in C. However, this article shows that in certain situations, compiled Python can beat C exactly because the programmer is relinquishing some control to the compiler/interpreter.

(via Hacker News)

  One Response to “Python Faster than C”

  1. Great write up, currently learning C/C++ and planned on moving to python next.

    Monko’s Blogs

 Leave a Reply

(required)

(required)


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>