News for hackers. Stuff that matters.
Re:Why Python Is Slow: Looking Under the Hood by mikkom on Tuesday November 18, 2014 @05:45PM (#8626883)
Almost all these points apply to javascript as well. Javascript, however, is not really slow anymore.

http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te...

Re:Why Python Is Slow: Looking Under the Hood by jerf on Tuesday November 18, 2014 @06:17PM (#8627048)
"Javascript, however, is not really slow anymore."

What's easy to lose track of under the steady stream of headlines about this microbenchmark going 5x faster and that microbenchmark going 10x faster and this one microbenchmark being "faster than C" is that Javascript is still a fairly slow language, though. Flick that to compare Javascript vs. C: http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te...

It has come a long way. It is, of course, still usable for many things. But it is still an interpreted language, and my guess is that we've basically plateaued on performance for Javascript, and it's important to remember that it isn't as "fast as C" in any useful sense of the term. And for that matter, to get even that performance out of JS seems to require you to write a very specialized subset of JS that will tickle the optimizers correctly. In practice I suspect you will get even worse deltas over C, which, for all of its many failure modes, does make it often easier to do the fast thing than the slow thing, usually regardless of the correctness of either of them.

(That's why we have asm.js, after all. You can't have both of "Javascript is as fast as C" and "asm.js is several times faster than Javascript", because the composition of both statements is absurd.)

Re:Why Python Is Slow: Looking Under the Hood by jlebar on Tuesday November 18, 2014 @06:02PM (#8626979)
> Almost all these points apply to javascript as well.

Sort of.

The article talks about why CPython, an implementation of the Python language, is slow. You're right that a naive implementation of Javascript would have many of the same problems, and indeed many of the first implementations of JS did have these problems. But due to heated competition, Mozilla, Google, Apple, and Microsoft have invested a huge amount of top-quality engineer-years into optimizing their implementations of JS.

Implementations of Python, in contrast -- and CPython in particular -- have not received the same sort of love.

I largely agree with the notion that the speed of modern JS engines serves as an existence proof that Python could be similarly fast.

Re:Why Python Is Slow: Looking Under the Hood by anentropic on Wednesday November 19, 2014 @05:06AM (#8629138)
that's what PyPy is http://speed.pypy.org/