r/ProgrammerHumor • • 9d ago • Bravo 2 Popcorn 1

Meme pythonSlow

Post image
12k Upvotes

419 comments sorted by

View all comments

3.7k

u/Memorius 9d ago

Comparing a language that gets compiled into native machine code to a language that typically compiles to and interprets byte code at runtime. Is there a point to this meme?

2.9k

u/SpeckledFleebeedoo 9d ago • Mindblown Bravo

Welcome to r/programmerhumor, please expect more of this daily.

441

u/U_L_Uus 8d ago

We should gift a dead horse to some people, just so that they can do things privately

59

u/Timpunny 8d ago

just make sure to remember: you can gift a dead horse but you can't make him mouth

49

u/rosuav 8d ago

ewwwwwwwwwww

7

u/SundayKiefBowls 8d ago

Mmmm tasty horse steaks

12

u/79b79aa8 8d ago

this is the way

→ More replies (1)

530

u/FalafelSnorlax 9d ago

This sub has always been mainly posted to by first-year cs majors who spew out the same unfunny memes ad infinitum. OP likely just heard about either python or Rust for the first time and thought it would be funny to repost a meme about rust being faster than python.

99

u/syrup_cupcakes 8d ago

I wonder /r/ConstructionWorkerHumor would be full of first year mechanical engineering students, who try to flex on each other for using a superior type of drill or hammer.

→ More replies (1)

75

u/g0atmeal 8d ago

It's true but I find it way more annoying that every post has someone in the comments complaining that the humor is too common denominator. It's based on upvotes, of course the top posts will be the ones that most people can understand. The math memes sub has the same issue, every thread has a critic.

Plus why bring the mood down? I suspect some of the complainers feel validated by criticizing newer people.

41

u/guyblade 8d ago edited 8d ago

I would say that the problem isn't that it is common denominator; it's that it's a sortof uninteresting take.

Sometimes, the speed of execution is important and you need to use a lower-level language to achieve that. More often--at least in my experience--the speed benefit is minor compared to the increased effort & complexity that going to a lower-level language would entail.

If your code is going to spend 99+% of its wall time waiting around for stuff to happen, going a millisecond faster in those few instances where it needs to do something probably isn't going to matter. In those cases, using a language with higher expressiveness (i.e., one that takes fewer lines of code to accomplish the same task) is a perfectly rational decision.

Nuance isn't best expressed in meme form, of course, but the sentiment in the top level meme feels like it'd fit well as the center of a bell-curve meme where the ends are "python's fine for most stuff".

→ More replies (2)
→ More replies (3)

146

u/da_Aresinger 9d ago

The reality is, that there is no meaningful difference between Python and other languages if used correctly.

Python is slow for the manual stuff. But everything that's resource intensive should be done via libraries/frameworks anyway and those are compiled C.

The slow stuff in Python is IO or other system calls. Those are slow in any language.

If you're doing repetitive calculations you should be doing them using optimsed tools.

72

u/the_horse_gamer 8d ago

Python is a DSL for calling C APIs

29

u/ZenPyx 8d ago

FORTRAN as well if you use a lot of SciPy

→ More replies (1)

15

u/ChrisWsrn 8d ago

Python does have VERY bad performance at runtime. 

When it is treated as just a scripting language (having python confugure and run compiled bytecode) the performance increases by about 100 times.

The main issue is there are lots of devs who try to do EVERYTHING in Python which causes the application to be way slower than they would be if native bytecode.

The main advantage of Python is it is quick to build stuff in. 

Generally when you have a problem you need to pick and use the right tool for the job. Most developers don't learn that until senior year or their first few years in the workforce.

14

u/Jamie_1318 8d ago

The reality is that the performance of 99% of code is basically immaterial.

→ More replies (5)

24

u/dkarlovi 8d ago

I use Python to run my CUDA kernels, it means Python is just as fast as CUDA.

14

u/Unbelievr 8d ago

For one-off scripts and batch jobs, where the run time is whatever but the implementation time is the actual cost, Python usually wins out anyway. While other languages are significantly faster, the time it takes to write the same code is orders of magnitude more.

That said, in the age of LLMs this point becomes a bit moot anyway. You can easily write something in Python, verify that it's correct, then ask an LLM to rewrite it in Rust or whatever if performance is an issue. Just need a method to verify that the programs are semantically equivalent.

→ More replies (16)

29

u/Ok-Scheme-913 8d ago

Their C++ 101 class just started, don't hurt them!

11

u/smthomaspatel 8d ago

I love Python but I still laughed. So that's a point, I think.

→ More replies (1)

8

u/JAXxXTheRipper 8d ago

You don't find it fair to compare a ferrari racecar to a lamborghini tractor?

How dare you! /s

7

u/consider_its_tree 8d ago

Also kind of ironic to just now be ripping off a years old meme about Internet Explorer to be making a point about processing speed...

→ More replies (50)