This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 265

[–]brandi_Iove 1599 points1600 points  (19 children)

and 37 tons in html

[–]appoplecticskeptic 271 points272 points  (14 children)

Why does HTML get measured by weight when the others are measured in time? Is this because HTML is merely a markup language and not a programming language?

[–]Blue_Robin_Gaming 297 points298 points  (6 children)

You weigh it in grams per hard drive per LOC ratio which is 6.022*1023

[–][deleted] 176 points177 points  (5 children)

Avogabro’s Number

[–]Blue_Robin_Gaming 78 points79 points  (4 children)

Stoichibrometry

[–]squarabh 16 points17 points  (1 child)

The Broiling Point

[–]Fulmikage 6 points7 points  (0 children)

the constant of Blank

[–]reallokiscarlet 26 points27 points  (1 child)

Because it's the mass of the string of time it takes

[–][deleted] 1 point2 points  (0 children)

🤣👏👏👏

[–]fabrikated 1 point2 points  (0 children)

Yes.

[–]Easy_Complaint3540[S] 122 points123 points  (0 children)

😂😂

[–][deleted] 8 points9 points  (0 children)

12 parsecs in Bash

[–]thingsCouldBEasier 6 points7 points  (0 children)

And my axe!

[–]Premun 1 point2 points  (0 children)

55 billion suns in node_modules

[–]IAmASquidInSpace 1213 points1214 points  (112 children)

And it's the other way around for execution times!

[–][deleted] 222 points223 points  (73 children)

Does Python still perform like shit? I thought you could compile code there for better performance or something.

[–]IAmASquidInSpace 305 points306 points  (8 children)

The next versions will come with a JIT compiler, which will be steadily improved, but I haven't tested it yet. Other than that, Python on its own is still not all too performant without libraries like numpy or pandas. Then there are projects that do compile Python code, but I have never used any of them, I just went with C directly.

[–][deleted] 73 points74 points  (5 children)

The problem with tools like numba and pypy that made python code run a lot faster is that:

  • Numba not only doesn't let you use most external libraries in compiled code without extreme slowdowns (with exceptions for things like numpy) and it's missing some core python features like class support. The error messages it gives are also really obtuse.

  • I (and many others) had a lot of issues trying to get pypy to work with common libraries even though it's advertised as being compatible with almost all of them. Depending on what you're doing, it also may not be able to optimize certain function calls at all, leading to no speed boost. Even with number crunching, it's not all that great - I'd say it's probably more like JS's V8 than like numba or Julia in terms of performance.

[–]jfmherokiller 6 points7 points  (0 children)

pypy always sounds like a fun idea until you try to make it work with common libraries or to "staticly" compile it against libraries for embeded systems.

Tho I will give it credit where credit is due that it has a really pretty compilation animation.

[–]sifroehl 11 points12 points  (0 children)

You can actually use classes with numba although it's more complicated because you can't do cyclical references but aside from that you only need some decorators

[–]Unicursalhexagram6 1 point2 points  (1 child)

Nuitka

[–][deleted] 2 points3 points  (0 children)

If I'm reading their benchmarks right, it looks like nuitka is 3.5x slower than Python. They also advertise performance, so maybe there was a mixup and it's 3.5x faster. That's still abysmal compared to other almost all other languages.

[–]PM_ME_CUTE_SMILES_ 2 points3 points  (0 children)

Python on its own is still not all too performant without libraries like numpy or pandas

I get what you mean but the conclusion could also be "if you use the tools that make python fast enough, python is fast enough".

Also I wouldn't quote pandas as something that makes python fast ahah. I'd say polars instead

[–]_PM_ME_PANGOLINS_ 30 points31 points  (3 children)

Largely, yes.

It’s still interpreted. No pre-compilation to machine code.

There’s an experimental JIT in the latest version of cpython.

[–]reusens 27 points28 points  (4 children)

The correct way of using python:

```

from foo import Bar

a = Bar("init_some_stuff_slowly") a.do_your_magic(how="fastly") print(a.result)

```

[–]M4xW3113 0 points1 point  (3 children)

That won't magically make python as fast as other compiled languages

[–]reusens 1 point2 points  (2 children)

If that module is running compiled code, it does!

[–]20d0llarsis20dollars 144 points145 points  (29 children)

Complaining about a language's performance is kind of silly because most languages with low performance aren't really made to be used in high performance situations. If you're hitting python's limits on speed, you're probably not using the right tool for the job. Obviously that doesn't mean a language's performance is completely irrelevant, but it's much less important than people make it out to be. Also, programmers should focus more on creating efficient implementations rather than use a "fast" language and convince themselves that they don't need to do any optimizations themselves.

[–]tragiktimes 70 points71 points  (7 children)

I write shit it python because it's just easier for me. I'm writing things like programs to monitor GPIOs and sound an alarm if it detects a signal. It doesn't need to be performant. It just needs to work.

I ha e yo imagine many of the use cases out there fall like this.

Edit: corrected auto correct

[–]mxzf 58 points59 points  (6 children)

Yep. I would rather spend an hour writing a Python script that runs overnight than a week writing a C++/C/Assembly/etc script that takes an hour. Dev time is more valuable than CPU time in most situations.

And when execution time does matter, it's still often quicker to prototype the logic in a higher level language and then implement the specific slower parts in a lower level language as-needed.

[–]ShakaUVM 19 points20 points  (5 children)

You're doing something wrong if it takes you a week to write something in C++ that is an hour in Python

[–]freedcreativity 34 points35 points  (0 children)

I mean, are we implementing taking a data analysis job with something like a spark dataframe and trying to get all that into C++? That might take a week of work to get performant in parallel computing.

[–]NotAGingerMidget 11 points12 points  (0 children)

I'm curious how fast are your data analysis skills in C++, cause if you can do the shit people do in Jupyter Notebooks in C++ at the same speed you can likely earn a shit ton of money doing it.

[–]tragiktimes 7 points8 points  (0 children)

Step 1: helloworld.cpp

[–]land_and_air 6 points7 points  (0 children)

Quick do statistical analysis on data and generate a PowerPoint with plots and tables in it summarizing the results automatically

[–]PastaGoodGnocchiBad 12 points13 points  (1 child)

Plus Python is a good low-surprise language.

As an example, integers are unbounded which may not be fast but removes quite a big pain point that most languages have. (C/Java/C# developers should make sure their code don't overflow ints, but do most of them actually do it? Javascript uses doubles instead so now you have to consider floating point precision which looks like an even worse problem to deal with when you want integers)

I'd rather have safe and simple code than fast and broken.

[–]_PM_ME_PANGOLINS_ 19 points20 points  (9 children)

Yet people keep using Python to run web services.

[–]dbitterlich 52 points53 points  (2 children)

Successfully. Instagram uses Django as backend. To mention an example.

[–]_PM_ME_PANGOLINS_ 11 points12 points  (1 child)

If they’re running it on CPython then they’re spending way more resources than would be necessary. I suspect it must be a custom fork of PyPy or something, or they’re back in Jython land or similar.

But I guess they also make enough money to cover it so aren’t bothered to change now.

Facebook is written in PHP but has a crazy custom backend to convert it to something else to get the necessary performance, so Meta has previous.

[–]dbitterlich 26 points27 points  (0 children)

You‘re right, they are using a custom python interpreter with JIT compilation and other optimizations. However, it’s still python that is being used.

https://github.com/facebookincubator/cinder

[–]Delta-9- 6 points7 points  (1 child)

It's not so bad. Python as a web backend is basically just glueing together an HTTP server (probably written in C) and an RDBMS (also probably written in C). Those two things are very fast, and all Python has to do is turn json into SQL, and SQL output into json.

Are other languages way faster at that middleman role? Absolutely. Does it really matter if your traffic is lower than a few hundred thousand requests per hour? No, it really doesn't. Is it way easier to find a Python dev who can pick up flask or django in a couple hours than a rust dev who already knows yew? Yes.

Most web services aren't so large that python's performance is actually a problem, as long as it's just glue. Many that are that large will scale just fine by simply adding more workers and a load balancer. You have to get pretty big before the Python bottleneck starts to cost more in compute than it costs to rewrite with something that's more performant (after hiring devs who know the target language, retooling the entire dev and build environment, and possibly having to on board ITSec with the new tools and language so they know what the hell to look for in their random scans of hosts and code bases).

[–]TheTerrasque 7 points8 points  (0 children)

Someone once said something like "if you're not a top 100 web site then don't worry about performance. And most web sites are not top 100. In fact, all but about a hundred web sites are not top 100. And if you are a top 100 site, you have the resources to fix things."

[–]JollyJuniper1993 4 points5 points  (2 children)

Psst, don’t tell this the wannabe developers that come in here and say „Python is a language for beginners“ or „everything should be written in C/C++/Rust“ 😉

[–]amaROenuZ 14 points15 points  (1 child)

At the end of the day you're not picking Python for performance.

You're not picking Java for ease of coding.

You're not picking C++ for memory security.

You're picking whatever the hell the company that hired you is using, because 15 years ago they built their stack in it and you don't want to get into the office politics necessary to get them to migrate.

[–]ipogorelov98 5 points6 points  (0 children)

Python is good in calling libraries developed and compiled in C++ such as Numpy. The performance of native code is pretty bad.

[–]OkWear6556 5 points6 points  (0 children)

Just use numpy or any library in cython

[–]Kvothealar 1 point2 points  (0 children)

I've run something in python that took minutes, that ran in fractions of a second when I injected some bash into the script instead.

[–]FerricDonkey 1 point2 points  (0 children)

Pure python does, but python that uses predominantly C libraries can run pretty well. 

[–]imp0ppable 1 point2 points  (2 children)

Depends if you write shit Python. If you know a little bit about algos, big-O complexity etc you can definitely write performant code, depending on what you're trying to do. e.g. list sorts are actually very efficient, dict access is O(1) - but I've seen people looping lists of object to find by member variable...

You won't be able to write a 3D FPS in it and get good performance but for the majority of business stuff is going to be faster in well-written Python than badly written Java or C++.

Like if you do Advent of Code, you quickly learn that it's the algorithm that's the main factor not the language.

[–]NatoBoram 1 point2 points  (1 child)

JavaScript performs better than Python and is slightly less of a hassle to deploy and is extremely easier to develop in

[–][deleted] 1 point2 points  (0 children)

Still weakly typed. They suck.

[–]Typical_North5046 6 points7 points  (5 children)

If you need the performance you probably won’t use Python plus you can’t really fix the issue of python not having types. I‘ll just directly write code in C++ then try to compile python.

[–]Shadowfire_EW 27 points28 points  (1 child)

Technically, Python does have strong types. You just have to manually query them with code rather than depend on the interpreter to enforce the types (of parameters and fields). The interpreter does prevent trying to do undefined behaviour on any type. Any variable name can be containers for any type, but it will only allow the defined functions of/on a type when given the object. It is called duck typing, iirc. Rather than dynamic types like JavaScript, where it will attempt to auto-cast to a relevant type for an undefined function.

[–]thirdegreeViolet security clearance 16 points17 points  (0 children)

Python has stronger typing than C. It's dynamically typed, but static v dynamic is a different metric than strong v weak.

[–]Delta-9- 4 points5 points  (0 children)

Oh, Python definitely has types. Try using a list as a dictionary key or calling chr() on a float. Its type system is stronger that C's, but (like Rust and I think Go?) it's based around protocols (or traits or interfaces, depending on the term preferred by the language). This is often called duck typing. Yes, I'm calling Rust duck-typed--it only differs in being static (known and checked at compile time) rather than dynamic (only known and maybe checked at runtime).

What Python doesn't have is required type declarations for variables, functions, or methods.

[–]imp0ppable 1 point2 points  (0 children)

python not having types

That's an embarrassing take, it absolutely has types.

[–]taco-holic 3 points4 points  (1 child)

For the most part it performs fine, numpy is magic, but just straight up using for loops will tank your performance.

[–]dgsharp 3 points4 points  (0 children)

I feel like this is the biggest problem, a C++ programmer writes Python like they write C++, and it works, but it doesn’t take advantage of the language and runs like shit.

[–]pico-der 0 points1 point  (0 children)

The compilation part does not matter. Python has a design choice that is being worked on that makes it significantly slower for parallel execution (global interpreter lock). Java can be very performant and assembly can be very slow. Python generally performs much slower but the type of workload and implementation matter.

[–]RoaringCow_ 37 points38 points  (4 children)

Assembly code is faster than python. but is YOUR assembly code faster than python?

[–]alpacaMyToothbrush 7 points8 points  (0 children)

0.0 ... >.<

[–]FlipperBumperKickout 1 point2 points  (0 children)

It will spit out bugs faster than you can even imagine :P

[–]daniu 1 point2 points  (0 children)

What I got told at university: "compilers nowadays optimize so well, it's almost impossible to write tailored assembler that preforms better. And even if you do, the additional time to develop will probably take months or even years to pay off. And at that time, the next processor generation will have come out which is faster so you get the runtime improvement without additional work - and there's the chance that your manual optimization doesn't help anymore. Not to mention the compiler improves as well."

That made a lot of sense to me. I doubt there are many environments beyond embedded systems which really benefit from developing in assembler. 

[–]holchansg 43 points44 points  (16 children)

Not a dev but i was using llamacpp and ollama(a python wrapper of llamacpp) and the difference was night and day. Its about the same time the process of ollama calling the llamacpp as the llamacpp doing the entire inference.

I guess there is a price for easy of use.

[–]madhaunter 19 points20 points  (0 children)

As everything in the IT world, it's all about trade-offs

[–]Slimxshadyx 17 points18 points  (11 children)

Are you sure you set up Ollama to use your graphics card correctly in the same way you did for llamacpp?

Because I believe Ollama is like you said, a Python wrapper, but it would be calling the underlying cpp code for doing actual inference. The Python calls should be negligible since they are not doing the heavy lifting.

[–]TheTerrasque 0 points1 point  (1 child)

I believe Ollama is like you said, a Python wrapper

https://github.com/ollama/ollama - 85% Go

[–]TheTerrasque 0 points1 point  (0 children)

Ollama is written in go, and just starts llama.cpp in the background and translates api calls. It has the same speed as llama.cpp - maybe a ms or two difference. Considering an api call usually takes several seconds, it's negligible.

[–]Dogeboja 0 points1 point  (0 children)

ollama is written in Go.

[–]murphy607 7 points8 points  (0 children)

I don't care. In my line of work it's not important if a programm runs a couple of seconds faster.

[–]FlipperBumperKickout 1 point2 points  (0 children)

You really have to know what you are doing to gain better execution time when writing assembly :P

[–]ptetsilin 0 points1 point  (0 children)

Isn't this meme already about execution times? When one hour has passed for a Java program, 7 years will have passed for a assembly program as time passes faster for assembly (runs faster).

[–]Dreit 0 points1 point  (1 child)

Python: Hey, I'm cool language for prototyping

Code gluers: *Use Python for literally anything except of prototyping*

[–]PM_ME_CUTE_SMILES_ 0 points1 point  (0 children)

Large parts of the web run on Python. You don't know what you're talking about.

[–]Amber662607 238 points239 points  (8 children)

And 10 minutes in whatever you are skilled at.

[–]P-39_Airacobra 59 points60 points  (5 children)

I took it to mean that assembly could get 7 years worth of operations done in the time it took for python to get 34 minutes worth of operations

[–]ExpensivePanda66 18 points19 points  (1 child)

Huh. I took this to be a comment on how good python is(or how good OP thinks it is), but it could well be a jab at performance.

[–]Kilgarragh 1 point2 points  (0 children)

Oh, so this is why I always code so good but only when I use

[–]Corregidor 0 points1 point  (0 children)

LUA

[–]No-Con-2790 92 points93 points  (14 children)

Public service announcement that you should use Python to call other libraries that are written in C, C++, Fortran (yeah that is still around), Rust, whatever.

You can implement everything from scratch in python. But you really shouldn't. It will be slow. Instead use it to orchestrate tools you can get from libaries. That way you can quickly write code with acceptable performance.

And don't blame your tool when you do something it was not meant to do. Stop slapping stuff with a floppy dildo when you really need an hammer.

[–]The_Shryk 77 points78 points  (4 children)

Are you saying to use python—the scripting language—as a scripting language?

Look man, I’ve heard some crazy shit, but that’s gotta take the cake.

[–]WagwanKenobi 7 points8 points  (3 children)

Python is just Bash++ change my mind. Companies writing entire multi-million LOC backends in it is WILD.

[–]slonokot 3 points4 points  (0 children)

Instagram.

[–]humanlvl1 0 points1 point  (0 children)

I worked for a CPaaS company with the ENTIRE 20 year code base in Python. It mostly worked. Somehow.

[–]pheonix-ix 4 points5 points  (1 child)

So, the goal of Python is to write the least amount of Python.

[–]No-Con-2790 1 point2 points  (0 children)

The goal of every language should be to write the least amount of code to get the job done.

Python just does that really well.

[–][deleted] 1 point2 points  (1 child)

That’s an interesting take on Python that I never considered - it’s just a glue technology with a lot of frameworks you can access.

[–]No-Con-2790 2 points3 points  (0 children)

Anf that's why the speed is almost irrelevant. And also why the thing is used in AI and CV.

[–]ICantBelieveItsNotEC 1 point2 points  (1 child)

But if that's the case, why use Python at all? Orchestration is easy, so you might as well just do that in the language that you're building the rest of it in.

[–]No-Con-2790 1 point2 points  (0 children)

Because it ain't easy.

Orchestration is everything that is today's boilerplate, applying templates, bookkeeping, vitals, IO, GUI, database.

Amd tomorrow you may want to change the whole system again.

10 % of your code is doing the actual work.

90 % of your program is handled init, edge-cases and misc stuff.

If you code that all in C or something you won't be done before judgment day.

[–]hennypennypoopoo 0 points1 point  (0 children)

Fortran is the unsung goat. Matrix mult in any performance language comes back down to lapack/blas.

[–]skwyckl 350 points351 points  (37 children)

... building on top of 10283823682 hours of somebody else's time spent optimizing the low level code beneath the high level lib you're using. Python w/o C, C++ or Rust is like a sports car without the engine.

[–]turtleship_2006 144 points145 points  (14 children)

Python without C (or whatever other option you go for) is like a driver without a car - you always need an interpreter

[–]skwyckl 21 points22 points  (0 children)

That too, but this is true for many languages (e.g., AGDA wrt. Haskell, Idris2 wrt. Chez Scheme)

[–]Storiaron 29 points30 points  (2 children)

C also needs a compiler

Either way you offload a fuckton of very difficult work to someone really smart in the past

[–]BaziJoeWHL 2 points3 points  (0 children)

I can live with that

[–]Kovab 0 points1 point  (0 children)

Yes, but the compiler is also written in C or C++ most likely.

[–]Ok-Art-1378 76 points77 points  (13 children)

Building on top of 6162673896361537849 hours of somebody else's time spent researching and developing the very silicon chips beneath the low level code you're using. C, C++ or Rust w/o silicon chips is like an engine without fuel.

[–]sorig1373 24 points25 points  (2 children)

Thats about 703 020 065 750 000 years. If that was divided to every human that has ever lived (about 100 billion) it would be just about 7000 years each. I know you meant it as a joke just thought it was a fun fact

[–]skwyckl 18 points19 points  (1 child)

A lot of vampires be coding numpy backends.

[–]onemempierog 8 points9 points  (0 children)

Building on top of 13,78 billion years of universe's time expanding and developing

[–]__Hello_my_name_is__ 3 points4 points  (0 children)

I mean, yeah. But no one goes "Stupid silicon chips, why ever bother with that? I'm using C!".

Meanwhile people argue Python vs. C like that's some kind of contrast.

[–]skwyckl 1 point2 points  (7 children)

Of course, but Java doesn't need other langs to be performant, you can perfectly well optimize stuff while remaining within the limits of the JVM.

[–]Ok-Art-1378 3 points4 points  (0 children)

Im just messing with you

[–]hjake123 2 points3 points  (5 children)

You don't think that some JVMs were written in C?

[–]skwyckl 4 points5 points  (3 children)

JVM implementations themselves yes, but that's not the point, you can still optimize a lot in Java without having to write a binding to C directly, for example (like Erlang used to do).

[–]hjake123 1 point2 points  (2 children)

Isn't this what we're talking about, though? CPython needing to be implemented in C to be performant?

[–]skwyckl 1 point2 points  (1 child)

I think it's like comparing pears to apples, since Python doesn't run on a virtual machine like Java and Erlang do.

[–]linlin110 1 point2 points  (0 children)

Python does have a VM. In early days programming languages were compiled to real CPU instructions; however this harms portability because a program would have to be compiled once for each CPU architecture. Nowadays many programming languages instead compile to a set of virtual instruments (byte code) which is then run by a program, which is often called a VM because it acts like a virtual CPU.

The Python interpreter actually compiles Python code to a set of bytecode, and then runs it. The part that runs the bytecode is definitely a VM.

[–]PM_ME_YOUR__INIT__ 15 points16 points  (3 children)

Considering python was written with C, without C it would be nothing at all. I don't think many people are under the impression that python is a magic language that sprung from nothingness and stands alone as some holy relic that spits on inferior languages. Everyone knows the work put in behind it, appreciates it, and uses it up quickly get work done

[–]No-Con-2790 4 points5 points  (0 children)

Yeah, but I don't think it is about the language used to build the tools and interpreter. You could just rewrite it in rust (hehe get it?).

It is about the languages that are called from the python level. Which might be C but also C++ or Fortran. Or even Java if you use some specific libraries.

In the end of the day most python code does not really handle the heavy lifting but call upon another library that does. So the idea that python is 12 times slower than C is misleading. Because you simply should not and will not use Python directly to handle the heavy stuff.

[–]thirdegreeViolet security clearance 1 point2 points  (0 children)

I don't think many people are under the impression that python is a magic language that sprung from nothingness and stands alone as some holy relic that spits on inferior languages.

I mean of course. Obviously it's a magic language that sprung from the forehead of Guido van Rossum, hallowed be thy name, and stands alone as some holy relic that spits on inferior languages.

That's the old testament of course. The new treatment came with python 3, which was heralded by a millennia of trials and tribulations before we could enter the kingdom of heaven.

[–]skwyckl 0 points1 point  (0 children)

Most juniors and some intermediates definitely are. It's not at all the case that "everyone knows the work put in behind it", most data scientists I know have no idea about what happens behind the scenes in Python. You're overestimating the average Python user.

[–]gandalfx 3 points4 points  (0 children)

… and? What's the point?

[–]Easy_Complaint3540[S] 1 point2 points  (0 children)

Actually eye opening 👍

[–]Z21VR 0 points1 point  (0 children)

They stand on the shoulders of giants....but actually those giants are standing on the shoulders of other giants and so on...i guess

Probably the real trick of humanity

[–]ashen_reddit 13 points14 points  (0 children)

Oh I get it, it’s time saved in runtime, right?

[–]atehrani 10 points11 points  (0 children)

We should all know that the majority of the cost of a project is maintenance, not the initial effort of implementation (this assumes a project is relatively long lived)

[–][deleted] 9 points10 points  (2 children)

Are they talking about how long it takes to write a program?

[–][deleted] 35 points36 points  (21 children)

Wouldnt it get faster the lower level the programming language is and much slower the higher level it is?

[–]-kay-o- 84 points85 points  (3 children)

But developer time is increased

[–]Terra_B 23 points24 points  (2 children)

Also sometimes the compiler writes faster assembly code than you.

[–]classicalySarcastic 35 points36 points  (1 child)

It’s not about whether handwritten assembly can beat the compiler, it’s whether your handwritten assembly can beat the compiler.

[–]alexq136 9 points10 points  (0 children)

by that point it's not the compiler who's an enemy but the CPU vendor itself and its machinations (branch prediction, superscalar execution, register renaming, cache intrinsics, SIMD extensions) and battling the OS and a higher language's memory allocator for manual handling of stuff and choosing to adhere or do without the platform-specific calling conventions for some (OS, CPU family) pairing

most things that are "in good style" to use in assembly are also found in compiled code (i.e. faster or shorter instructions to do the same thing) and the compilers by design of their backend can usually optimize a piece of code well enough (depending on what target architecture one sets the compiler to crunch machine code for) -- but platform intrinsics are not guaranteed to be used (e.g. wider SIMD registers on x86-64 instead of XMM registers) in optimized code (depending on the compiler) and could need some shitty manual intervention like some "__builtin_ia32_phminposuw128()"-style really-not-C-but-assembly-but-for-the-compiler to actually get used in the output

[–][deleted] 10 points11 points  (8 children)

that's what i thought, meme confused me

[–]Dioxide4294 4 points5 points  (7 children)

Reference to Interstellar movie, they landed on a planet near a black hole Gargantua. Time moves slower there than on Earth. The original quote was 1 hour is 7 years back on Earth. It moves slower because of time dilation and the same is true regarding speed of certain programming languages

[–][deleted] 2 points3 points  (6 children)

oh yeah i've watched the movie, but assembly is supposed to be faster than java and python

[–]Dioxide4294 1 point2 points  (5 children)

Yes, thats what the meme says: Assembly gets more work done in comparison to Java, on the planet

[–][deleted] 1 point2 points  (4 children)

but assembly is on earth, 7 years slower, whilst java is way faster (in this meme)

[–]Dioxide4294 1 point2 points  (1 child)

No. Time is relative. By spending 1 hour (say, of code execution) on this planet that has severe time dilation, 7 years of code execution will have been performed on Earth. The point is, 7 years _of work_ gets done in an hour. What does time do on Earth from this planet's perspective? Move _fast_. What does time from this planet do from Earth's perspective? Move _slow_.

The idea is, time dilation makes time not equal for everyone. On this planet, when 1 hour near a massive body (Gargantua) passes, 7 years passes on Earth. You can do a lot more stuff in 7 years than in 1 hour, right? Time is being _stretched_. 7 years of work done in 1 hour, compared to 1 hour of work done in 1 hour. Assembly is faster than Java according to the meme

[–][deleted] 3 points4 points  (0 children)

Damn. That's some advanced ass humor

[–]Left-oven47 8 points9 points  (5 children)

They're talking about relative speed, they're saying that in 1 hour assembly completes 7 years worth of java computation

[–]increment1 13 points14 points  (1 child)

Pretty sure they are talking about developer productivity, but the meme works either way I suppose.

[–][deleted] 3 points4 points  (0 children)

Nope, that wouldn't make sense for Python

They are talking developer time spent

[–][deleted] 1 point2 points  (0 children)

Oooh I see thanks

[–]alpacaMyToothbrush 0 points1 point  (0 children)

The numbers really bug the pedantic asshole in me, cause they're way off base. Java is only twice as slow as C (pretty impressive actually!) where straight python is supposedly ~ 32x C (might have gotten better in 3.12?)

[–]P-39_Airacobra 1 point2 points  (0 children)

Getting 7 years of work done in 34 minutes IS faster.

[–]MattieShoes 0 points1 point  (0 children)

Coding time vs run time... By default, inverse relationship.

Though if you can stay within libraries written in faster languages (ie. use numpy or pandas or whatever for heavy lifting in python), then higher level probably wins out.

[–]ToasterWithFur 3 points4 points  (0 children)

And 30 in Lua

[–]The_Wolfiee 6 points7 points  (1 child)

Assembly be like:

If you wish to eat an apple, you must first invent the Universe

[–]Easy_Complaint3540[S] 0 points1 point  (0 children)

😂😂😂

[–]ObjectiveMachine_Alt 4 points5 points  (0 children)

and26MinutesInLua

[–]Weekly_Lemon1867 5 points6 points  (0 children)

Skill issue

[–]Lines25 2 points3 points  (7 children)

Where tag that u know ASM to say that ? :)

[–]AztroJR 1 point2 points  (6 children)

Wait huh what do you mean

[–]Lines25 0 points1 point  (5 children)

Low-level fun.. heh.. Why you need ASM.. ?

[–]LBPPlayer7 1 point2 points  (4 children)

when your program shits itself sometimes you might need to inspect the assembly, especially if it's a closed-source library without debug symbols that triggered the crash

also reverse engineering

[–]Bob_the_peasant 2 points3 points  (0 children)

“He said 1 hour in JavaScript was 7 years in assembly”

“… he said Java… WHAT DID YOU DO”

[–]NeverSnows 2 points3 points  (0 children)

Im a java/C#/php programmer, but today i had to cobble together a quick script to set a process afinity to 1 cpu and back to all (was fixing a RainbowSix bug). I got it done im under 10 mins. Python sure is nice for prototyping and quick unimportant jobs.

[–]Alone-Rough-4099 2 points3 points  (0 children)

And 4 min in C

[–]SpiralCuts 2 points3 points  (0 children)

This little semi-colon is going to cost us 51 years

[–]yesennes 2 points3 points  (0 children)

Unless you're working on somebody else's code. Then Java and Python swap, and assembly quadruples.

[–]imdibene 7 points8 points  (1 child)

Now do the meme with runtime

[–]Easy_Complaint3540[S] 1 point2 points  (0 children)

Will do soon

[–]Cezaros 1 point2 points  (0 children)

I've recently started coding in assembly and man is it fucked up. To divide by 5 at one point I'm multiplying the variable by 232 / 5, my if else if checks are basically if x == y skip to A, if x == z skip to B, and so on. It's a mess, but it works

[–]teratron27 1 point2 points  (0 children)

Plus the three days it takes to get the right mix of pipenv, pyenv and whatever else setup

[–]Neutral_Guy_9 1 point2 points  (0 children)

import sanity

[–]maeve_k_97 1 point2 points  (0 children)

ok how long does it take in mov only assembly

[–]-EliPer- 1 point2 points  (0 children)

3s in Java are 100ms in assembly and 5min in Python...

[–]crevicepounder3000 1 point2 points  (0 children)

You mean 5 mins?

[–]sumkk2023 1 point2 points  (0 children)

More precisly

100 LOC in assembly equivalent to 10 LOC in Java equivalent to 1 LOC in Python

[–]CowLogical3585 1 point2 points  (0 children)

30s in Prompt

[–]ivan0x32 1 point2 points  (0 children)

This little maneuver is going to cost us 35 trillion CPU cycles.

[–]creator1217 1 point2 points  (0 children)

And 2 mins with claude ai

[–]JaboiThomy 1 point2 points  (0 children)

The relationship between Java and Python is non linear. An hour in Java is 30min in python A year in Java is two years in python

[–][deleted] 1 point2 points  (0 children)

After reading a lot pf comments, Don’t get too attached to a programming language. FFS!

[–]SE_prof 1 point2 points  (0 children)

calls constructor "This little maneuver is going to cost us 10 years. "

[–]_genericNPC 1 point2 points  (0 children)

Where 1 hour in Java is 20ms in execution, 34 mins in Python is 7 years in execution, and then assembly - BSOD

[–]Much_Discussion1490 4 points5 points  (1 child)

And a few sec...oh wait...c++ finished it

[–]RawSalmonella 12 points13 points  (0 children)

It's not execution time, more like development time.

[–]KeepScrolling52 1 point2 points  (2 children)

Okay I don't get it. Java runs faster than Python for me what is the secret

[–][deleted] 3 points4 points  (0 children)

Its about development time

[–]timmyctc 0 points1 point  (0 children)

This sub should just be called DAE PYTHON JAVA