Why Python will never be fast

Yesterday, when reading the Tracemonkey stuff, I realized this. The question “My code runs slow, how to make it go fast?” has two answers: “Improve the compiler/runtime to make it go fast.” and “Rewrite it in another language that can go fast.” As long as the second option is possible, there’s just no need to spend a huge amount of brain on the other option.

Besides, I’m back from my holidays where I’ve played with Flash 9 scripting in Swfdec. While it won’t make it for Swfdec 0.8, I’m positive 0.10 will play ABC-scripted Flash.


#1 Anders on 08.24.08 at 13:03

Steve Yegge doesn’t agree.


#2 Rob J. Caskey on 08.24.08 at 13:20

That is a horrible idea and you have obviously not thought this through. I seriously expect better from a code-jockey who should at least understand the time it would take to rewrite every program of a certain language vs the time to have a compiler optimized and rewrite only the few that actually needed a language transplant.

#3 rawsausage on 08.24.08 at 13:54

What Steve is after is some 3-5 years away, perhaps even further with the present development pace.

#4 stefan on 08.24.08 at 13:55

This doesn’t make any sense to me…

Why do you mention Python in particular ? (btw isn’t IronPython fast ?) Why not Perl, Erlang or whatever ? Did you mean “why all the interpreted languages except javascript won’t ever be fast” ?

Doesn’t Google’s use of Python pretty much guarantee that brain power will be spent on making it faster, letting python users concentrate on writing apps (as opposed to hacking python itself or porting their code to some other language) ?

I dunnow, I guess it’s your blog, you write whatever you want on it (and I’m happy to read it) but here… I have no idea what you’re talking about :p

#5 Zeeshan Ali on 08.24.08 at 15:15

Who cares, we have Vala now. :)

#6 Stu on 08.24.08 at 16:05

What about pypy ? I don’t see why this means python will never be fast.

#7 rawsausage on 08.24.08 at 16:47

Vala would be my choice for developing desktop applications too. It doesn’t have the worst of the shortcomings of C/C++, and it seems to be quite pleasant to develop with already.

#8 Andrés G. Aragoneses on 08.25.08 at 00:09

Were you referring to just CPython? Or did you include IronPython, Jython, etc.?

#9 Oommen K M on 08.25.08 at 04:51

Its Oommen, senior software analyst working for CROSSTEL, West Point, USA at the offshore development center of rkc Infotech, Philadalphia, USA.

I saw threads which says ‘Why Python will never be fast’.

My opinion is, “yes python codes can run faster than any other. I am telling you from my experience.
I have written a python code which continuously reads a xml stream from an external device, manipulates and returns back the device a result in xml format. Thing is that my client is already having c code which handles this process. My python code handles 1740 xml streams in a second while the C code handles only 375 streams in a second. Please be reminded that python code does 3 fetching and a insertion for each stream with my MySQL database, while the C code does not have any interaction with the database.

So its sure that Python is faster than any other language, since it uses the optimum resources for its execution.

Please be informed that many scientific institutions, like NASA, are using python for their heavy calculations.

please check these links:-



#10 mystilleef on 08.25.08 at 23:54

How about profiling your code to figure out the hotspot?

Have you considered using psyco (JIT for Python)?

#11 Lucian on 09.08.08 at 08:57

Python is quite fast, still much faster than js. The point is, they’re both fast enough most of the time. And don’t underestimate PyPy.