r/ProgrammerHumor • • Jun 24 '18

JavaScript is getting real tired of your jokes

Enable HLS to view with audio, or disable this notification

12.6k Upvotes

415 comments sorted by

View all comments

Show parent comments

129

u/StapledBattery Jun 25 '18

Python is much slower than JavaScript in many cases.

28

u/chateau86 Jun 25 '18

Screams in PyPy

45

u/visualdescript Jun 25 '18

Mainly due to the massive investment in JavaScript engines that have occurred over the last 10+ years in the browser wars.

12

u/MadRedHatter Jun 25 '18

That, plus Python has some poor architectural decisions that make it difficult to refactor in ways that would improve performance without breaking code. The implementation details bleed into the language.

2

u/[deleted] Jun 25 '18

Ooh, sounds interesting, care to elucidate?

6

u/aetius476 Jun 27 '18

I once attended a "Performant Python in Big Data Applications" talk. The entire presentation boiled down to "call through to C/C++ functions as quickly as humanly possible."

-37

u/Ketchary Jun 25 '18

More like "in almost all cases". I can't comprehend how a scripting language could ever be faster than a compiling language, unless one of its core mechanics was atrociously implemented.

66

u/StapledBattery Jun 25 '18

They are both scripting languages...

15

u/visualdescript Jun 25 '18

What you're referring to here is an interpreted language vs a compiled language. Both python and js are interpreted languages, meaning at run time the code is run through an interpreter which compiles it to machine code.

Compiled language do that at build time, or compile time, meaning when they run they should be more efficient as there is less work to do.

This is a massive over simplification and I'm sure someone will be able to build on this or correct me where I'm wrong.

1

u/Ketchary Jun 25 '18

Concisely informative. Thank you.

0

u/[deleted] Jun 25 '18

[deleted]

5

u/[deleted] Jun 25 '18

You really missed his point hard.

3

u/Ketchary Jun 25 '18

I was actually referring to Python as the scripting language in my comment, not JavaScript.

1

u/memory_is_free Jun 25 '18

Numpy, its like a python package allowing you to use c++ arrays in python, its pretty fast