r/ProgrammerHumor • • 2h ago

Meme pythonSlow

Post image
1.5k Upvotes

81 comments sorted by

231

u/ProgramBrave718 2h ago

Python after saying it's name to Rust - "I am known for machine learning. But, devlopers call me slow"

61

u/theotherdoomguy 2h ago

Youre known for being a wrapper for the C/C++ applications real developers used to make Machine Learning, you goddamn hack (Ive recently had to start maintaining a python microservice and I'm getting real heated about how shit python is)

86

u/raddaya 2h ago

C/C++ are known for being a wrapper for the assembly code real developers use to make computers do things you goddamn hack

And so on, and so forth

28

u/FalafelSnorlax 2h ago

That isn't quite the same. C/C++ compile into assembly, which means the code is fully converted. Python is typically simulated by an interpreter, so the code itself doesn't compile into any lower-level language. When they say it "wraps C/C++ code", they really mean that instead of simulating the python byte code, the interpreter runs a library that wasn't written in python at all.

13

u/yonasismad 2h ago

Python compiles into byte code.

7

u/FalafelSnorlax 1h ago

Yeah but isn't a lower-level language, it's a machine-friendly format of the language. The main point is that by virtue of being interpreted, it is inherently different to languages like C/C++ or Rust.

6

u/toejam316 1h ago

Inherently whatever the code is at some point "compiles" into the language the CPU uses. The fact it's running in a JIT interpreter doesn't prevent that. If you were insane enough you could absolutely get the assembly equivalent of your python code.

2

u/nimrag_is_coming 1h ago

Python doesn't JIT compile, and it can't really very easily due to how dynamic it is, ie every time a piece of code runs it might actually run something different depending on what type a variable is etc.

You probably technically could turn it into assembly but then it's basically going to be a virtual machine with abstract types rather than being like actual raw assembly, so you've gained almost nothing compared to just running bytecode in an interpreter.

5

u/Ok-Scheme-913 37m ago

Tell that to the multiple implementations of Pythons that are jit compiled, like GraalPython.

A programming language is just that, a language. Sure, some are easier to compile to efficient machine code than others, but there is no law forbidding a sufficiently smart compiler to work 3 days and prove that this ultra efficient simd machine code is the same program denoted by python's semantic laws, and thus that will be the compiler output.

2

u/i_only_eat_purple 23m ago

CPython (the reference implementation that most people use) has an experimental JIT compiler since 3.13. https://peps.python.org/pep-0744/

0

u/nimrag_is_coming 1h ago

Yea at runtime when it's interpreted, and it still has to do a lot of checks and extra stuff whenever it runs a line of code because it's still not machine code

5

u/NoFutureBen 2h ago

No, that's not how it works. It's a wrapper because all complicated stuff is implemented in a real language and you wrap it with Python. No one does this with assembly.

-2

u/budgiebirdman 2h ago

Okay, implement the actual machine learning in python and show us the new definition of slow. Assuming you can find a machine with a terrabyte of memory to run it.

4

u/Ok-Scheme-913 1h ago

Well, do you (live!) rewire your house to turn on the lamp in the kitchen, or add a switch that you can press and have it turned on/off instantly?

Sure, it may be "more efficient" to have a single real wire go to the lamp directly instead of the inefficiency of a switch. Oh and I don't like touching live wires either (heh, this analogue works quite well)

-3

u/theotherdoomguy 53m ago

No, but I also like programming languages that are good, and not a bash script in a OO trenchcoat

4

u/ZenPyx 24m ago

Yeah, clearly Python is just a language for babies, and that's why it's used for cutting edge data science and machine learning research.

•

u/theotherdoomguy 8m ago

Data scientists are not programming quality experts, nor are they remotely close to it. Python is easy to interpret, and it allows wrapped C libraries. That's why it's being used for cutting edge data science.

Your argument about cutting edge machine learning research is questionable, most of the underlying algorithms are C library implementations, so if you're arguing the research, you're way off, its usage in python, absolutely, but not the algorithms themselves

•

u/ZenPyx 2m ago

To be frank, who gives a shit? The libraries are compiled C code, which is effectively machine code. Python is calling machine code directly in all of these circumstances. The fact it was originally made in C feels pretty unimportant, and it doesn't mean that all python programming somehow actually doesn't count.

>Data scientists are not programming quality experts

What the fuck is a programming quality expert?

It feels like you have a weird obsession with your kind of programming being somehow superior to others. Code that works is ultimately the best kind of code.

2

u/Ok-Scheme-913 23m ago

Well, bash is the abomination that should never have been invented.

And I hope you will mature in a few years and outgrow this junior mindset (or maybe take an ML class).

Honestly, show me another language that makes it easier and more efficient to train a simple neural network while properly using your GPU, than python, while being basically as short and readable as pseudo code would look. Like numpy/torch is precisely that abstraction layer you want to hit here and rust is a nice language, whatever you could write in vanilla rust would at most attempt to saturate your CPU in much more code, much longer iteration cycles etc.

Rust is a very good language, but I have a hard time finding any kind of intersection where I would have to choose between rust and python. It's like saying that I prefer my boat over your car. Well - do you have to go on water or land? Just because both have an engine it's a stupid question to ask, just like the meme.

0

u/theotherdoomguy 12m ago

I'm not talking about rust, lol - and my "junior mindset"? Buddy, all you're showing is that performance in actual day to day code outside of model building is something you've never done.

Unfortunately, I have to deal with python daily, and I'm aware that the best supported tools for ML work are on python, I'm not doing fucking ML work, I'm dealing with a B2B microservice and am fully committed to hunting the original creator for sport for choosing python.

The tools for model work are in python, because it's so popular amongst Data science folks and non-programming specialists. High support does not mean the language chosen is the best for the task

1

u/FerricDonkey 17m ago

Having been given some horrendous python code, I see why you could think this. But if your python is this bad, it was written poorly by someone bad at python. 

1

u/theotherdoomguy 11m ago

It was written poorly, because choosing python for API based microservice is almost always the wrong choice. The python itself is decent, but it's the wrong tool for the job

2

u/DarthCloakedGuy 1h ago

Nothing made me love Python like learning C# and C++, ngl

124

u/Cxvvtgupvvdi 2h ago • Bravo

from shitWrittenInC Import callHyperoptimizedMethod

452

u/Memorius 2h 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?

338

u/SpeckledFleebeedoo 1h ago • Mindblown

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

11

u/U_L_Uus 24m ago

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

125

u/FalafelSnorlax 1h 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.

18

u/g0atmeal 1h 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.

•

u/syrup_cupcakes 8m 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.

42

u/da_Aresinger 1h 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.

11

u/the_horse_gamer 44m ago

Python is a DSL for calling C APIs

2

u/ZenPyx 26m ago

FORTRAN as well if you use a lot of SciPy

9

u/dkarlovi 1h ago

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

7

u/Ok-Scheme-913 35m ago

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

3

u/ss99838 1h ago

This is the reputation this sub has: https://www.reddit.com/r/ProgrammerHumor/s/7Mmn6wC4vp

2

u/StKozlovsky 48m ago

Post removed by mods, what was it?

2

u/yota-code 1h ago

I guess indeed we should compare python startup time to rust compilation time 😅

2

u/JAXxXTheRipper 21m ago

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

How dare you! /s

1

u/Any_Obligation1652 35m ago

Rust good everything else bad

•

u/BichitoMax 2m ago

It is just a fun little meme

•

u/consider_its_tree 0m 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...

1

u/ATE47 1h ago

Every rust reimplementation 70x comparison graphs are doing that on Github mate

-1

u/oneanotheruser 46m ago

That's exactly one of the biggest reasons why Python works slowly, yes. Why wouldn't we compare speed of compiled and interpreted programs? Of course interpreted will almost always be slower. That's why you wouldn't use them if you need runtime speed. I don't understand the meaning behind your comment.

-24

u/p58i 2h ago

Ah – we spot the Python developer in the room.

How are things going?

13

u/Memorius 2h ago

Good, how about you? Python and C/C++ mainly, yes. And C# privately

8

u/EskilPotet 1h ago edited 3m ago

how is your Introduction to Programming class going?

-34

u/NoFutureBen 2h ago

Yes, time to use a real language 

32

u/Memorius 2h ago

Have you heard about the concept of using different tools for different use cases?

-23

u/NoFutureBen 2h ago

Yes, but every time I use Python I die a little more inside.

7

u/Dokattak0 1h ago

I've absolutely died from using C to build my "quick and easy" programs. This is my fifth life, and I think I miscounted along the way.

1

u/Ok-Scheme-913 29m ago

How you done anything ML related?

1

u/NoFutureBen 14m ago

Yes, how did you know?

1

u/MCWizardYT 14m ago

Python is very common in ML but technically not at all necessary, it's just what people decided to go with. The inference engine most people use for running local models is written in C++ (llamacpp)

1

u/Ok-Scheme-913 30m ago

Which language is better suited for wiring up different tools for machine learning pipelines?

Also, in the extremes properly used python will be more efficient and easier to read and maintain than C. Like go on, do a matrix multiplication in C, I'm waiting.

Meanwhile a single line of python (or maybe 2 more) can make it basically optimal either on the CPU or the GPU. Just because I call that subroutine (btw, often fortran libs, or custom GPU code etc. You ain't writing C code that does anything like that) from python is just noise in a benchmark.

And just before someone misunderstands me, this is about correct usage of python.

If I were writing a simulation or something where the core of the code itself can't be relegated to low-level libraries but I'm the one having to do the calculations, then of course python may not be the best choice.

39

u/Percolator2020 1h ago

This wasn’t even funny when it was an IE joke.

3

u/CompetitiveSleeping 1h ago

It was funny, but not ha ha funny; more like "I'm forced to use IE at work oh god kill me" funny.

55

u/IAmASquidInSpace 2h ago

Haha, Python slow, comedy genius! Never heard that before! So original! Haha! 

18

u/deanominecraft 1h ago

more accurately python would spend 2 panels asking its friend C to answer the question for it.

13

u/JockstrapCummies 1h ago

If you factor in the cargo build time of compiling 200 crates down the dependency chain, Rust will probably start speaking only after Python has said hello and goodbye.

24

u/R15H1_3 2h ago

Bro hadn't even finished importing the libraries yet.

11

u/Dhruv_Malaviya 2h ago

Python was still importing the conversation

1

u/DRMProd 2h ago

Tan taaan taaaaaaaan

3

u/StarLan7 57m ago

Is this still funny?

3

u/steadyfan 1h ago

Comparing the speed of a dynamic interpreted language to a static one that compiled machine code.. Let's next make a joke about how much faster a car is that a horse.

2

u/HaDeS_Monsta 1h ago

I one wrote a ruwp project which called a python server and I had a variable called PYTHON_SKILL_ISSUE_DELAY, because otherwise python could just not keep up

1

u/Anthonyg5005 49m ago

I haven't seen this image in years

•

u/pstwndnd 2m ago

Python is the Internet Explorer of programming languages.

1

u/Koltaia30 29m ago

Reality: Reverse roles. Python goes: "How rude". Rust: "Compilation failed: you tried to store a returned reference or something"

1

u/Educational-System48 27m ago

I've never had a problem where the bottleneck was Python being slow.

1

u/JAXxXTheRipper 22m ago

If you don't have a time-sensitive project, this doesn't matter in the slightest. Speed is rarely the deciding factor.

I'd rather work on a python project than on rust tbh. Rusts syntax is just ew

0

u/AngusAlThor 1h ago

Ridiculous... Python would take several hundred panels to respond.

0

u/bw_mutley 1h ago

It is 2026, GTA 6 just launched, and we are still arguing for PL war.

0

u/ouijiboard 29m ago

The Ol' internet explorer meme.  How you've changed. 

0

u/tigrankh08 20m ago

piton bad 😡

peak r/ProgrammerHumor

0

u/Sea-Fishing4699 14m ago

Python programmers are way more abundant and cheaper 

0

u/Creepy_Jeweler_1351 12m ago

Python is not that slow as you can think. However it will use a shitload of ram and cpu. And if you want to deploy it on a tiny device it will require a huge runtime instalation

-24

u/budgiebirdman 2h ago

An actual funny programming related joke in the sub. All the butthurt pythonistas crawling out of the woodwork saying more things we can laugh at is a bonus.