r/ProgrammerHumor • • 2d ago

Meme pythonSlow

Post image
9.8k Upvotes

399 comments sorted by

849

u/ProgramBrave718 2d ago

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

238

u/creeper6530 2d ago

Python is an orchestrator for C/C++ libraries at this point 

115

u/MegaPegasusReindeer 2d ago

The default implementation of Python is CPython. It's always been byte code running C written machine code.  There's even Cython to write Python that compiles into C code.

23

u/FlyingRhenquest 2d ago

Yeah, it's great for that. I built an automated video test system for Comcast back in 2018 that was heavily-threaded C++ code with a Pybind11 API to send requests and retrieve responses to the backend. The system was responsive in real time as long as you didn't saturate the image recognition thread pool.

13

u/HeisterWolf 2d ago

This so much lmao. Most code I write is basically Python orchestrating other processes or an FFI to something like rust if it's performance-critical.

126

u/theotherdoomguy 2d 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)

212

u/raddaya 2d 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

→ More replies (28)
→ More replies (45)

7

u/wildjokers 2d ago

Python is just calling out to c and c++ libraries.

→ More replies (1)

374

u/Cxvvtgupvvdi 2d ago • Bravo

from shitWrittenInC Import callHyperoptimizedMethod

783

u/YamroZ 2d ago edited 2d ago

The Python script was ready week ago, took 5 minutes. Rust programmer first took 3 days to tell EVERYONE how much better it will be in Rust, then started coding and got bogged down for 2 days in a forum discussion on how to best secure memory for a "hello world!" string.

217

u/VladVV 2d ago

Meanwhile the Julia developer was done a week ago like the Python developer. Took 5 minutes all the same, and it ran faster than the eventual Rust implementation. No one gave a flying shit and used the Python implementation anyways because it's more familiar.

191

u/FaCe_CrazyKid05 2d ago • Popcorn

Who’s Julia and what language did she program in

59

u/RamsOmelette 2d ago

My question is who is Jason

→ More replies (7)

51

u/LetumComplexo 2d ago

You know what they say, the only thing better than best is standardized. /half joke

18

u/Erpelstolz 2d ago

Problem is I cannot use all the libraries for Julia

→ More replies (4)
→ More replies (1)

16

u/boberro 2d ago

Then they just vibe coded it

→ More replies (10)

3.3k

u/Memorius 2d 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.5k

u/SpeckledFleebeedoo 2d ago • Mindblown Bravo

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

381

u/U_L_Uus 2d ago

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

48

u/Timpunny 2d ago

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

45

u/rosuav 2d ago

ewwwwwwwwwww

→ More replies (2)
→ More replies (1)

487

u/FalafelSnorlax 2d 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.

89

u/syrup_cupcakes 2d 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)

65

u/g0atmeal 2d 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.

37

u/guyblade 2d ago edited 2d 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)

4

u/tsammons 2d ago

I got fileted once upon a time over NFA/DFA here. Kid just took his very first combinatorics class, and the schmuck in me wanted to give him a high five but my tail was too far between my legs after the three paragraph dissertation.

→ More replies (2)

137

u/da_Aresinger 2d 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.

70

u/the_horse_gamer 2d ago

Python is a DSL for calling C APIs

28

u/ZenPyx 2d ago

FORTRAN as well if you use a lot of SciPy

→ More replies (1)

24

u/dkarlovi 2d ago

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

12

u/ChrisWsrn 2d 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.

12

u/Jamie_1318 1d ago

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

→ More replies (3)

13

u/Unbelievr 2d 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 2d ago

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

11

u/smthomaspatel 2d ago

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

→ More replies (1)

10

u/ss99838 2d ago

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

4

u/StKozlovsky 2d ago

Post removed by mods, what was it?

8

u/ss99838 2d ago

Link to a screenshot: https://ibb.co/ccF1LPkx

Why can we post gif in comments but not images?

→ More replies (1)

8

u/JAXxXTheRipper 2d 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 2d 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...

2

u/yota-code 2d ago

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

2

u/Any_Obligation1652 2d ago

Rust good everything else bad

2

u/frivol 2d ago

(I'd say the type system matters way more than compilation.)

2

u/doulos05 2d ago

Python!

No really, that's the whole point of the joke.

2

u/PudgeNikita 2d ago edited 2d ago

the compilation vs interpretation difference is honestly not as big as between the language semantics making the program include information on static value types with fixed sizes, in contiguous memory vs chains of references to "objects" with boxing required even for things like numbers, each with a vtable, stored in non-homogeneous containers. so, as u/frivol mentioned, its more about the type system (or, the type system up to the degree as to which it can be pessimistically, with 100% sureness, be used by the implementation) and the data layouts that the type system (and more generally the information provided by "definitions" in the program, and the assumptions that can be made about it, e.g. "closed system", immutability) results in. python functions could be overriden at any point by an outside module loaded dynamically, and the implementation has to consider that as "standard behavior", so it cant "just inline the function", specially if its generic but cant be monomorphized since the type of the argument isnt known for certain even if its typehinted since it could either not be consistent with the typehint, or be a subclass with an overriden method (and python methods dont even need to marked virtual, its just duck typing all over).

2

u/anonuemus 2d ago

rust developers are insufferable, that's why they make those memes

2

u/unski_ukuli 2d ago

I think python and rust are more alike than most languages. The defining similarity is that people try to do things in both languages that should not be done in them.

3

u/BichitoMax 2d ago

It is just a fun little meme

-29

u/p58i 2d ago

Ah – we spot the Python developer in the room.

How are things going?

18

u/Memorius 2d ago

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

15

u/EskilPotet 2d ago edited 2d ago

how is your Introduction to Programming class going?

→ More replies (35)

205

u/Percolator2020 2d ago

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

80

u/CompetitiveSleeping 2d ago

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

25

u/creeper6530 2d ago

That reminds me of the "are you forced to use Edge? You may be entitled to a better browser" advert Firefox made recently 

→ More replies (2)

159

u/IAmASquidInSpace 2d ago • Mindblown

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

15

u/WrennReddit 2d ago

Quick, somebody get this guy a vibe coding meme!

60

u/deanominecraft 2d ago

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

→ More replies (3)

12

u/cicciograna 2d ago

I remember when the butt of this joke was Internet Explorer.

29

u/irishcoughy 2d ago

ITT people who write code for a living or as a hobby seemingly unable to grasp that programming languages have use-cases and are rarely if ever universally applicable.

15

u/squabzilla 1d ago

One of my favourite learning experiences was writing C code to read a .txt file, and return the average number of letters per word.

We couldn’t use any libraries except the standard input/output library, so I’m reading stuff character by character, storing it in my own custom-built linked list, make sure there aren’t any memory leaks…

And the next lesson started by showing us how to accomplish the same task with 10 lines of Python code.

And you wanna know which one was faster? Well, as far as my human perception could tell, both of them ran instantly. I mean, sure, technically the compiled code written by the comp sci PHD was a tad faster, but who actually gives a shit?

There’s a reason C++ isn’t used for data analysis. (Or why Python isn’t used for video games for that matter.)

4

u/HumanContinuity 1d ago

Basically the entire python data science and AI/ML ecosystem is just a bunch of C/C++/Rust wrappers.

If you could write them natively in python, you would absolutely see a difference when you throw them even mid sized datasets 

→ More replies (2)

3

u/gundam1945 1d ago

I think for the case of data science, the cost of writing something wrong is more costly than the slow speed. And a good thing is everyone have a agreed way of doing the methods, with the public library.

→ More replies (1)

2

u/olorochi 20h ago
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <ctype.h>

typedef unsigned long ulong;

int countWordChars(FILE *fp, ulong *words, ulong *sum)
{
    char buffer[4096];
    bool inWord = false;

    size_t read;
    while ((read = fread(buffer, 1, sizeof(buffer), fp))) {
        for (int i = 0; i < read; ++i) {
            unsigned char c = buffer[i];
            if (isspace(c)) {
                *words += inWord;
                inWord = false;
            } else {
                ++*sum;
                inWord = true;
            }
        }
    }

    *words += inWord;
    return ferror(fp);
}

int main(int argc, char **argv)
{
    ulong words = 0;
    ulong sum = 0;
    for (int i = 1; i < argc; ++i) {
        FILE *fp = fopen(argv[i], "r");
        if (fp == NULL) {
            perror(argv[i]);
            return 1;
        }

        int err = countWordChars(fp, &words, &sum);
        fclose(fp);
        if (err) {
            perror("Read error");
            return 1;
        }
    }

    if (words == 0) {
        puts("NaN");
    } else {
        printf("%f\n", (double)sum / words);
    }
}
#!/bin/python
import sys

words = 0
chars = 0

for filename in sys.argv[1:]:
    with open(filename) as f:
        for line in f:
            for word in line.split():
                words += 1
                chars += len(word)

print(chars / words if words else "NaN")
~ $ du -h yes
862M    yes
~ $ time ./a.out yes
3.000000

real    0m3.555s
user    0m2.748s
sys     0m0.538s
~ $ time ./words.py yes
3.0

real    1m25.753s
user    1m24.416s
sys     0m0.613s
→ More replies (5)

11

u/spottiesvirus 2d ago

people is also unable to grasp "language efficiency" is way less relevant than what they think it is

in modern CPUs a single RAM lookup consumes 200+ CPU cycles just waiting for the response, let alone a network request querying a disk on a server somewhere (I'm looking at you fragmented microservices)

that kind of architectural optimization is way more important than "I'm using C because JavaScript is less efficient"

6

u/violetvoid513 1d ago

Performance is the least of javascript's sins

2

u/TemporaryFearless482 1d ago

Next you’re going to tell me that the PHP OS was a bad idea.

→ More replies (1)

28

u/MiloBem 2d ago

Python is slow but that's not a problem for a scripting language which is used for data pipelines, prototyping, and teaching coding basics to high schoolers. No one sane is using it where performance matters, like microservices. Oh, wait.

14

u/danfay222 2d ago

I mean I know this is a joke but python is used for a lot of heavy production loads. For example instagram is built on a Django backend

5

u/Blue_Moon_Lake 2d ago

I don't wonder why so many websites run like shit, I only wonder what type of shit is going on in the backend.

9

u/Acceptable-Pin2939 2d ago

The slow points are almost never the code execution but other things like io / http / other overheads.

Why is why python is used.

→ More replies (4)

18

u/HikariAnti 2d ago

This meme is actually pretty accurate because Rust programmers will tell you that they are Rust programmers without you ever asking.

17

u/SeaTurtle1122 1d ago

If the speed of Python is, in any situation, your bottleneck, you’re doing something stupid. The large majority of all modern code is IO bound, not compute bound, and if you’re doing compute intensive work, pandas, scipi, tensorflow, google OR tools, and a number of other libraries exist to do it properly, and if none of those work, writing C code with a wrapper for Python isn’t hard. There’s boilerplate and considerations, but there are lots of tutorials and it isn’t mechanically difficult to do.

Python has issues, but if you’re complaining about Python and aren’t focused primarily on the awful state of Python package management, you don’t know enough about Python to make jokes about it.

→ More replies (1)

16

u/Educational-System48 2d ago

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

7

u/anzu3278 2d ago

That's right, all the other problems of Python kick in much sooner

→ More replies (1)

21

u/JockstrapCummies 2d 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.

10

u/Soumalyaplayz 1d ago

Ah yes. A compiled language which takes ages to compile vs an interpreted language which takes ages to interpret.

This war was promised to us 3000 years ago

5

u/Lowmax2 2d ago

Python can be lightning fast when you use the right libraries. Obviously it's written in c++ or something on the back end, but it's still python being written by the end user.

25

u/JAXxXTheRipper 2d 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

3

u/FabioTheFox 2d ago

Just use Golang atp

You get all the simplicity with all the speed

2

u/JAXxXTheRipper 2d ago

I am not allowed to comment on this, I am an unashamed golang fanboy.

→ More replies (1)

1

u/anzu3278 2d ago

Python devs when a language has syntax other than whitespace: "ew"

14

u/JAXxXTheRipper 2d ago edited 2d ago

Rust devs when someone complains about their syntax

I dOn'T sEe ThE PrObLeM *rolls head across keyboard*

fn f<'a, 'b: 'a>(x: &'a &'b ()) -> impl for<'c> Fn(&'c ()) -> &'a () {
    let _ = [|| || ..=.., || || ..=..];
    match Some(&mut 1) {
        Some(ref mut y @ &mut _) => *y = &mut 2,
        _ => return return return move |_| *x,
    }
    move |_| *x
}
→ More replies (5)

20

u/RhuanPacheco 2d ago

Why are you crying so much over Python memes? When a JS meme gets posted for the millionth time, there isn't nearly as much complaining...

22

u/FabioTheFox 2d ago

Because everyone knows Javascript sucks and everyone bashes it all the time, the difference is that people don't want to admit the same with python

43

u/Pokari_Davaham 2d ago

Python is nice to code in, I don't think anyone pretends it's the fastest

20

u/LetumComplexo 2d ago

Yeah, that and while it’s not fast on its own it is adequately fast when used correctly.

11

u/mxzf 2d ago

Especially when you factor in development time vs execution time. It's super quick to develop in compared to many languages, and you can always come back and optimize specific slow things down the road if you have bottlenecks.

→ More replies (2)

3

u/JollyJuniper1993 2d ago

People pretend it has to be good at things it was never meant for. Complaining Python is slow is like complaining x86 has a lack of libraries.

17

u/Worth-Wonder-7386 2d ago

Python is among the most used programming languages. It is not suited for everything, but that is true for all languages.

→ More replies (17)
→ More replies (7)

3

u/WiseEXE 2d ago

I think it's because Python while easy to write, it's ecosystem feels completely braindead at times because of all the abstraction layers. As someone who transitioned to Python from writing native C, the amount of thought taken away from me gets irritating.

Take variables for example, writing variables without an explicit type feels messy (I know you can do type declaration but that's more of a bandaid fix). Then I'm genuinely not a fan of the "Pythonic way to code". It's oversimplified and makes critical thinking feel like slop.

2

u/GresSimJa 2d ago

The dynamic-but-also-not-dynamic typing is fucking infuriating. It makes it so you need to check for types manually anyway, and dealing with user input is a hassle.

→ More replies (1)

1

u/Clairifyed 2d ago

I’m tired of this format regardless of what languages they slap into it

→ More replies (1)

4

u/urbaum 1d ago

Show me you know nothing about programming

26

u/R15H1_3 2d ago

Bro hadn't even finished importing the libraries yet.

12

u/lostUd_ 2d ago

as someone who finds programming to be incredibly boring and will avoid computer science by all means necessary, I find this sub pretty funny

11

u/WiseEXE 2d ago

Then why are you here? Not trying to be rude just asking

3

u/SaintWillyMusic 2d ago

come for the jokes, stay for the empathy

5

u/lostUd_ 2d ago

got recommended to me in my home feed (cause I switched to linux like 8 months ago) and I still kinda found it funny so i stayed

For a little more context: I tried picking up programming back when I was like 7 and stuck with it for nearly 5 years. by then, I was really burnt out, and realized it wasnt my thing.

2

u/Dr_Dressing 2d ago

Man, that's unfortunate.

You reckon it's different now? I know it isn't the same thing, but I didn't like champignon when I was 7 through 12.

→ More replies (1)

1

u/DefiantGibbon 1d ago

As someone who also doesn't like coding...

It's incredibly unfortunate that I became a Sr embedded engineer who writes C all day, lol.

6

u/Trang0ul 2d ago

- Knock, knock!
- Who's there?
- ...
- ...
- Python!

- Knock, knock!
- Who's there?
- C++ !

- Knock, knock! Assembly!

3

u/Unlucky-Durian-2336 2d ago

I still remember "knock knock" Java joke from years ago.

3

u/Liliths_Ace_Friend 1d ago

My brain runs on python

3

u/admiralsj 1d ago

Yes Rust is more performant, but... many high volume production sites run with python back ends. 

Both will do the job in probably 99% of use cases. Yes Rust is faster but Python has a more mature ecosystem and is easier for noobs

10

u/steadyfan 2d 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.

→ More replies (2)

16

u/Dhruv_Malaviya 2d ago

Python was still importing the conversation

1

u/DRMProd 2d ago

Tan taaan taaaaaaaan

5

u/RedAndBlack1832 2d ago

Me when scripting language used for scripting and rapid development:

it doesn't need to be fast, and when you want something done fast, you call into a C/C++ library

4

u/TactfulOG 2d ago

r/programmerhumor try not to compare different use case languages for 1 fucking day impossible edition

6

u/tigrankh08 2d ago

piton bad 😡

peak r/ProgrammerHumor

3

u/anzu3278 2d ago

Tbh if grownup software engineers were this upset and defending Scratch as a real language it would be just as funny.

→ More replies (1)

2

u/RED1869 2d ago

Python still being there when Rust is long gone

2

u/heckingcomputernerd 2d ago

If you account for compilation time, you can swap rust and python in this meme lmfao

2

u/Buyer_North 2d ago

same as C++ with Rust

2

u/Andrei95 22h ago

Mehh, this really depends on what you are doing. I took a monster spreadsheet that we use for design calcs. Essentially, it's a bunch of linear algebra and some optimization routines; it took 10+ seconds to update the sheet every time you changed a single input. I moved it over to Python with a mix of numpy and scipy, nothing fancy, just basic stuff, that got it down to under a second (~100s ms). Then I went to pure functions with Numba njit, which got me down to the 10s of microseconds range. I doubt going from njit to something like Rust or C would be any faster. Maybe for non math dominated tasks it might be different, but for me numpy/scipi or numba is as fast as possible, without having to spend crazy amounts of time on it.

2

u/1_89 22h ago

Counterpoint: python bindings for non-programmers

3

u/Sirico 2d ago

We need this tool by Friday...

3

u/liggamadig 2d ago

Well, the computer's time is cheaper than mine so I'll continue using Python.

3

u/SrWloczykij 2d ago

The world was a much better place when Rust bros were still hiding in their cellars.

4

u/StarLan7 2d ago

Is this still funny?

3

u/not_perfect_yet 2d ago

This is inaccurate, Rust should be unreadable. ;)

3

u/Koltaia30 2d ago

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

2

u/zyxzevn 2d ago

It is the reverse. Rust will still be compiling....

2

u/alliewya 2d ago

Claude, rewrite this meme in rust, make no mistakes

2

u/danfay222 2d ago

Python is only really slow if you have no idea how to use it. Sure it’s never going to beat compiled lower level languages like rust or cpp, but if you use and build proper libraries for your application in python it’s often a lot closer in performance than most people think

2

u/HaDeS_Monsta 2d ago edited 2d ago

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

6

u/WiseObjective8 2d ago

That's called rate limiting not the python having some magical delay.

-1

u/HaDeS_Monsta 2d ago

The python server was part of the project and running on the same machine without rate limiting, but the rust program called it twice in a row, which it couldn't handle

6

u/WiseObjective8 2d ago

You cannot have a server without rate limiting even in local. Any webserver you setup with python still will have a default limit on concurrency. Depending on the library you used, you can configure a number for how many requests you want the server to handle at a time. Anything exceeding this number will get rejected. This is different from user level rate limiting. You can handle thousands of req/s given that your config and machine can handle it. What you described sounds like a fault in your setup or you don't know how to work with python.

1

u/Anthonyg5005 2d ago

I haven't seen this image in years

1

u/Fancyness 2d ago

made me chuckle

1

u/Relevant_Research_98 2d ago

Shall we conveniently forget that rust gets compiled for eternity? Also make rust icon bigger.

I've made tools that prevents running `rm /tmp` etc and runs $0.unsafe if args are not sus, it takes ~10 times more space than core-utils' rm.
And it's lucky day if you try to make something with bevy and endup without wasting many gigabytes.

1

u/knowits 2d ago

fixing legacy python scripts is hell because you spend more time waiting for pip install than actually coding. meanwhile rust devs brag about their borrow checker saving them from segfaults while i stare at a yaml indentation error for three hours. shit world we live in where runtime errors are preferred over compile-time anxiety. i just want my code to run fast enough to close my laptop before battery dies

1

u/Understanding-Fair 2d ago

I've met both these people IRL

1

u/jakechance 2d ago

Something was said, not good!  https://youtu.be/MzkWyhzwO1Q

1

u/BoobooSmash31337 1d ago

I would be shocked if PyPi doesn't have a print string intrinsic. Also would assume the string copy dwarf the function call overhead. So they'd do similar work in practice. I assume Python immediately drops to a more native layer to print to stdout.

1

u/DJcrafter5606 1d ago

I have to say the title could be a little bit more original 😅😅😅

1

u/GhostVlvin 1d ago

Rust compiles for ages while python runs for ages
Btw this is rebranding of same meme but with c++ instead of rust

1

u/KevinJRussell 1d ago

They coulda done this with Javascript instead of Rust and gotten the same results

1

u/AngusAlThor 2d ago

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

1

u/ouijiboard 2d ago

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

1

u/Krustenbaecker 2d ago

I read with 1Hz temperature sensors and store them. No reason to do this faster.

→ More replies (1)

1

u/Successful_Noise_347 2d ago

Python is not slow. It is just waiting for the C library underneath to finish.

1

u/Dry-Refuse-8132 2d ago edited 2d ago

This is a brain dead take by people. Python can call C libraries or Rust libraries anytime. It more easily integrates with custom kernals (CUDA). OP is the slow one IMO.

Do hard compute tasks using the right libraries, or use your own well written libraries and you can get all the performance you want in python. It's also 10x more readable.

Oh, and the compiler writes all the real code anyway...

1

u/Alternative_Act_6548 2d ago

not a rust fan, but that is funny

1

u/kiochikaeke 2d ago

It's been 0 hours since the last "python is slow/python is just calling C"!

The record is 0 hours!

1

u/SLOOT_APOCALYPSE 2d ago

..............J A V A has........... (Minutes go by) Updated..... Successfully

1

u/throwawayaccountau 2d ago

Now do it with Chinese Python.

0

u/bw_mutley 2d ago

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

0

u/Own_Recommendation49 2d ago

The amount of salty people who are python shills is hilarious

0

u/hraath 2d ago

Not shown: rust showing up and python staring at it wonders what it's doing for an hour type checking and compiling

-1

u/pstwndnd 2d ago

Python is the Internet Explorer of programming languages.

-1

u/an_alex_at_a_time 2d ago

Every conversation with women that I've matched online aka bots went the same way lol

-1

u/slaymaker1907 2d ago

I'm going to push back on this and say that high-performance Python is totally possible. There's Cython which is super fast and if it's numerical code, you can use numba.

And obviously Python has very good C-interop. Rust has interop too, but it doesn't place nicely with the the borrow checker.

1

u/anzu3278 2d ago

So python is fast as long as you don't use python?

1

u/lmcinnes 2d ago

I have written pure python libraries that use numba for JIT compilation that have been performance comparable to C++ and Rust libraries for the same task. It is certainly quite possible. Sure one might be able to wring out a little extra performance with a compiled language, but not very much, and likely with quite a lot of effort.

0

u/slaymaker1907 2d ago

What part of Cython did you not read?

2

u/anzu3278 2d ago

The part after it says compiles python into something else.

0

u/korneev123123 2d ago

Python strong sides are being easy to read and easy to write. And a lot if wonderful libraries, making it even easier. Unfortunately, it no longer matters, since all the writing is made by ai. It is no longer my language of choice for web api :(

0

u/ratbastid 2d ago

It's like my joke about Java.

Knock knock.
Who's there? . .
.
.
.
.
Java.

0

u/turtle_dragonfly 2d ago

Reminds me of an older joke:

Knock knock

Who's there?

(long pause) ...... ....... ..... ...... Java!

⠀

⠀

(VM startup time is a pain)

0

u/Ok_Actuary8 2d ago

FUCK YOU TONY!

-26

u/budgiebirdman 2d 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.

-1

u/Sea-Fishing4699 2d ago

Python programmers are way more abundant and cheaper 

-1

u/Creepy_Jeweler_1351 2d 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

-3

u/DT-Sodium 2d ago

Python is so dumb it would probably have misspelled its name.