Live data from Hacker News

Why Python, Ruby, and Javascript are Slow

speakerdeck.com

1–10 of 203 posts

Re: Why Python, Ruby, and Javascript are Slow

#3
Great bit of slides. Straight and to the point. If you've ever ventured under the hood of Python you'd see this in the code. If you've ever had to optimize the bejeesus out of code in C++ or C, you'd know exactly the kinds of things he's talking about.

Re: Why Python, Ruby, and Javascript are Slow

#4
Kind of a poorly-named deck. It's really about why programs use features of these languages that end up causing poor performance relative to C, rather than why the individual VMs themselves are slow. It's no surprise that trading the byte-precision of C for the convenience of a garbage collector and heap-allocated data structures results in a performance decrease.

Dynamically-typed languages are often easier to program in, but require more copying (and memory allocation) as a result. Hash tables are heap-allocated and have to be garbage collected, but they're flexible - something you don't get with structs. Allocating and freeing memory has a cost, and that can add up quickly. Your primary line of optimization in most of these languages is "avoid the GC", which really boils down to "don't allocate more than you need to", which is sound advice in every language, scripting or otherwise.

Re: Why Python, Ruby, and Javascript are Slow

#7
post #4

Kind of a poorly-named deck. It's really about why programs use features of these languages that end up causing poor performance relative to C, rather than why the individual VMs themselves are slow. It's no surprise that trading the byte-precision of C for the convenience of a garbage collector and heap-allocated data structures results in a performance decrease. Dynamically-typed languages are often easier to progr…

I'm certain you could have a language that is easy to program in, but doesn't use so much copying or use dictionaries so much. I'm not sure such a thing exists, though.

Re: Why Python, Ruby, and Javascript are Slow

#8
post #5
post #2

It is almost time that people stop referring to Languages as Fast or Slow. It is an implementation that is fast or slow, not a language.

Have you considered reading the fucking presentation before snarking out on it?

What makes you think I didn't? The author seems to agree with me. He even concludes that we should improve the implementation rather than the language for optimisation.

Re: Why Python, Ruby, and Javascript are Slow

#9
post #2

It is almost time that people stop referring to Languages as Fast or Slow. It is an implementation that is fast or slow, not a language.

I think its time people stop using shitty slide decks to get their point across.

He gave a talk yesterday at Waza, Heroku's conference. I believe Heroku is planning on uploading videos of the talks in the coming days.

I've been interested in this talk since I saw it announced on Twitter, but prefer to watch/listen rather than go through these slides.

Re: Why Python, Ruby, and Javascript are Slow

#10
post #4

Kind of a poorly-named deck. It's really about why programs use features of these languages that end up causing poor performance relative to C, rather than why the individual VMs themselves are slow. It's no surprise that trading the byte-precision of C for the convenience of a garbage collector and heap-allocated data structures results in a performance decrease. Dynamically-typed languages are often easier to progr…

If the deck is to be believed, it's not the garbage collector or the heap that's causing the performance loss, it's that APIs and algorithms they enable are allocation-heavy compared to other "faster" languages.

Heap allocations are expensive even in non-GC languages.

Post reply on HN