Thread 105837500 - /g/ [Archived: 425 hours ago]

Anonymous
7/8/2025, 3:34:08 PM No.105837500
1751981642
1751981642
md5: a3a9bc71c0cc60a2f0a19896c642888b🔍
Is this the reason why C++ and Rust are so much slower than C, Hare, Zig, Odin ...?
Replies: >>105837510 >>105837543 >>105837789 >>105837822 >>105837868 >>105840215 >>105840672 >>105841032 >>105842186 >>105844601 >>105845548 >>105846288 >>105846741
Anonymous
7/8/2025, 3:36:13 PM No.105837510
>>105837500 (OP)
> if you have a C program and a C++ program that do the same thing, the C program will tend to run a bit faster

This hasn't been true for like 40 years now.
Replies: >>105840487
Anonymous
7/8/2025, 3:41:08 PM No.105837543
>>105837500 (OP)
I imagine Rust is slower because the people refactoring all the programs into in Rust from C/C++ aren't doing it with the knowledge required. There is a huge difference between converting code from one language to another and writing code in a language with understanding and a plan. There is always something lost in the translation.
Replies: >>105840215
Anonymous
7/8/2025, 3:42:31 PM No.105837550
fastest-elapsed
fastest-elapsed
md5: 32b71980a7d6f34f694ce3e6433c5430🔍
Replies: >>105837602 >>105840604 >>105844601 >>105845573 >>105847346
Anonymous
7/8/2025, 3:43:10 PM No.105837557
rust is slower because the gender borrower needs time to check your transition from an unsafe gender to a safe gender
Replies: >>105837584 >>105840215
Anonymous
7/8/2025, 3:47:30 PM No.105837584
>>105837557
>see technology
>instantly think about sexual degeneracy
What made cniles like this?
Replies: >>105837596
Anonymous
7/8/2025, 3:48:52 PM No.105837596
>>105837584
what a roundabout way of admitting you have indeed not seen this technology
Replies: >>105837617
Anonymous
7/8/2025, 3:49:47 PM No.105837602
85b
85b
md5: 45843d0a7c4d6803ab1f158eae211b83🔍
>>105837550

I'm proud of C#
Anonymous
7/8/2025, 3:51:34 PM No.105837617
>>105837596
I have been programming for like 15 years.
Replies: >>105837892
Anonymous
7/8/2025, 4:14:23 PM No.105837789
>>105837500 (OP)
>a retard quoting another retard with zero low-level technical knowledge who may have randomly heard of "data-oriented programming" (touted as some "big discovery" by gayme retards and their teenage followers)
the blind leading the blind
stupidity travels faster than wisdom
it's all retards all the way UP
Replies: >>105838302
Anonymous
7/8/2025, 4:19:19 PM No.105837822
>>105837500 (OP)
No. Whoever is posting that is retarded.
Anonymous
7/8/2025, 4:24:57 PM No.105837868
>>105837500 (OP)
Maybe if you are abusing virtual function calls (in which case you are retarded), otherwise class member functions are the same thing as a regular function with a hidden this argument, at least in c++.
Anonymous
7/8/2025, 4:26:15 PM No.105837883
if op is wrong then why rust so slow
Replies: >>105837887
Anonymous
7/8/2025, 4:27:32 PM No.105837887
>>105837883
Post benchmark
Replies: >>105837899
Anonymous
7/8/2025, 4:28:11 PM No.105837892
>>105837617
irrelevant
Anonymous
7/8/2025, 4:28:47 PM No.105837899
>>105837887
>c fast
>rust slow
explain this
Anonymous
7/8/2025, 5:10:00 PM No.105838302
>>105837789
That is a lot of words for saying "I don't understand how caches work, my programs are slow, but I don't want to learn how to improve it because I am lazy"
Replies: >>105838344
Anonymous
7/8/2025, 5:14:40 PM No.105838344
>>105838302
NTA
Learning bunch of buzzwords will not automatically make your argument valid.
Anonymous
7/8/2025, 8:19:19 PM No.105840215
>>105837500 (OP)
>>105837543
>>105837557
lol these retards actually think "rust slow"
Replies: >>105840561 >>105840659
Anonymous
7/8/2025, 8:45:52 PM No.105840487
>>105837510
This guy (https://www.youtube.com/@SheafificationOfG/videos) has a series where he tries to compute the largest fibonacci number in one second. In this video specifically (https://www.youtube.com/watch?v=LXm6ygZ3h7A) he switches to C because the assembly output is easier to predict and thus the program is practically easier to optimize. Mike Acton in his famous C++ con rant mentions that he would just prefer everyone stick to ansi for the exact same reason, predictable assembly output.
Replies: >>105840535
Anonymous
7/8/2025, 8:50:40 PM No.105840535
>>105840487
>Mike Acton in his famous C++ con rant mentions that he would just prefer everyone stick to ansi for the exact same reason, predictable assembly output.
Uh huh yeah.... and that's why he works for Unity now and does C#? Acton makes a lot of good points in theory but his advice is impractical and he deserves all of the criticism he receives for it. There is a reason why he only gave that talk one time, because nobody listens to him or wants to hear him rant about the cache efficiency of a boolean value for 15 minutes.
Replies: >>105840699
Anonymous
7/8/2025, 8:52:39 PM No.105840561
>>105840215
yes
Anonymous
7/8/2025, 8:56:55 PM No.105840604
>>105837550
What’s naot mean?
> c#
Impressive. Powershell written in C#? Not impressive.

> java
Bullshit, in the real modern world.
I just tried running this java github web api thing, and I didn’t have enough compute in the whole office to run it.
It’s obscene.
I knew it would be bad when saw multiple Spring Frameworks banners. Ate through a 25 GB partition and looked for more and crashed before it was booted.
A friend of mine clipped out the functional bits an put them in jetty tomcat and now it runs on a pocket calculator now.
Replies: >>105840692 >>105845548
Anonymous
7/8/2025, 9:02:08 PM No.105840659
>>105840215
I don’t think rust is really slow, languages with mandatory heap usage, garbage collectors, etc should be on a different tier. That’s about it.

Speed, however isn’t everything.
One of the best programming lanugages is ‘raku’ for getting shit done… it’s pretty incredible. But it’s among the slowest. In the world, right up there with powershell.
Replies: >>105840684
Anonymous
7/8/2025, 9:03:54 PM No.105840672
>>105837500 (OP)
Because they spam the heap like a bunch of illiterate web devs.
Anonymous
7/8/2025, 9:05:17 PM No.105840684
>>105840659
the bororw cehcker forces heap suage
Anonymous
7/8/2025, 9:05:51 PM No.105840692
>>105840604
Java programs can be some of the most elegant things, especially carefully crafted embedded firmware written by like one or two guys running on a small VM with its own executive.

No one pays for software like that though and java hasn't been hip for 20 years so no one is doing it for fun anymore either. Kind of sad.
Replies: >>105840795
Anonymous
7/8/2025, 9:06:15 PM No.105840699
>>105840535
Run cfront automatically, then. We all used to back in the day.
C is close to portable assembly.
Why rust doesn’t just emit C like cfront did is a retarded idealogical/cultist philosophy…at least in the beginning, eh?
Anonymous
7/8/2025, 9:16:50 PM No.105840795
>>105840692
Hotspot is theoretically faster than C because (again) theoretically it could do things like re-order case tests to put the most frequent ones first, or re-order instructions at runtime to completely fill pipelines or prevent stalling or allow more functional units to complete before loading more ops on different units. Just by “watching” it for a while and re-issuing instruction blocks.

All wasted tech due to tards. Java seems to have attracted the worst developers
Anonymous
7/8/2025, 9:39:27 PM No.105841032
>>105837500 (OP)
Rust is not an object oriented language, it’s faster.
Anonymous
7/9/2025, 12:00:25 AM No.105842186
>>105837500 (OP)
It's not, but many people who write C++/Rust are not cognizant of stack/heap usage compared to C programmers
Anonymous
7/9/2025, 6:03:19 AM No.105844601
>>105837500 (OP)
Based. POOP is like ORM for the memory

>>105837550
Another day another total humiliation of gotards
Replies: >>105845338
Anonymous
7/9/2025, 7:22:05 AM No.105845119
Does C put things on the stack that C++ and Rust put in the heap?
Replies: >>105845228
Anonymous
7/9/2025, 7:36:53 AM No.105845228
>>105845119
The post is referring to spatial locality but eveyone itt talking about heap allocation.
Replies: >>105845340 >>105845384
Anonymous
7/9/2025, 7:56:19 AM No.105845338
>>105844601
> gotards
If you look at the go assembly output, It has all these fucking panic check calls everywhere.
The assembly looks like -O1 or maybe -O2 but not terrible.
Of course it’s a gc language so you can’t expect much.
Anonymous
7/9/2025, 7:56:25 AM No.105845340
>>105845228
heap allocation vs stack, and the layout of said allocation is spatial locality, though
you dont keep all your program in cache
some of it usually sits in your ram
and if you have to juggle around instructions from all over the place it DOES incur a penalty
in a way, your instructions are also data. theyre also information, so they have similar properties
Replies: >>105845382
Anonymous
7/9/2025, 8:01:42 AM No.105845363
Are we talking about struct of arrays again?
Replies: >>105845371
Anonymous
7/9/2025, 8:03:06 AM No.105845371
annoyed-pepe
annoyed-pepe
md5: d44f6efacd41e619a788fef22efc0fc1🔍
>>105845363
no
if you have nothing to add, why do you take part in the discussion?
Anonymous
7/9/2025, 8:05:18 AM No.105845382
>>105845340
Mem allocators these days are sufficient enough to minimize internal fragmentation. Also the post was referring to icache not dcache. OOP concepts like runtime polymorphism can reduce performance.
Replies: >>105845434
Anonymous
7/9/2025, 8:05:24 AM No.105845384
>>105845228
So in C are functions stored differently than class methods in a way that caches better?
Replies: >>105845420
Anonymous
7/9/2025, 8:10:57 AM No.105845420
>>105845384
Good compilers usually inline functions agressively which increases the performance. It is harder to do it if you have multiple inheritance like in C. So the instruction pointer has to jump around.
Replies: >>105845426 >>105845444
Anonymous
7/9/2025, 8:11:59 AM No.105845426
>>105845420
I meant multiple inheritances in C++.
Anonymous
7/9/2025, 8:12:25 AM No.105845434
>>105845382
>Mem allocators these days are sufficient enough to minimize internal fragmentation
have you tested it?
because i know it to be false

>Also the post was referring to icache not dcache
i know. what made you think i dont?

>OOP concepts like runtime polymorphism can reduce performance.
yes they can. thats the object of the op
whats your point?
Replies: >>105845471
Anonymous
7/9/2025, 8:13:55 AM No.105845444
>>105845420
C won’t have multiple inheritance, lambdas, generics until C26
Replies: >>105845454 >>105845482
Anonymous
7/9/2025, 8:16:16 AM No.105845454
>>105845444
this is fucking retarded
and all the while the comission wants to transition into sepples we still dont have a force inline directive

i think ill stick with c99 for a while yet
Anonymous
7/9/2025, 8:19:47 AM No.105845471
>>105845434
My point was that people itt thread are ignoring the orignal post.
Replies: >>105845502
Anonymous
7/9/2025, 8:21:31 AM No.105845482
>>105845444
I meant to say C++. C23 still doesn't have lsp support. I don't think anyome cares about nu C.
Anonymous
7/9/2025, 8:25:12 AM No.105845502
>>105845471
well, i didnt
information locality is a very important consideration
but in what concerns instructions-
i think you would have to use a really big variety of functions in a short timeframe, like parsing a database of thousands of varying objects each with their mpethods
or a few with very long methods to begin to see a performance hit
but there is one to be expected an it can be quite large bc it will involve loading instructions from ram
Anonymous
7/9/2025, 8:26:47 AM No.105845511
I'm confused.
Is OP trying to say that an object's methods live alongside the object in memory?
Replies: >>105845519
Anonymous
7/9/2025, 8:28:12 AM No.105845519
>>105845511
its not needed to achieve fragmentation
thats not how i understand op even if his picrel seems to be written by a gorilla
Anonymous
7/9/2025, 8:34:31 AM No.105845548
>>105837500 (OP)
>you call a lot of class object functions
The post in your image has a strange way of saying "virtual methods". Also, using virtual methods is not required when programming C++, even when using it idiomatically. There is also an equivalent in C to C++'s virtual methods, and that is function pointers. In all cases, the question will arise "is my need for polymorphism greater than my need to shave a few cycles off the runtime?"
>>105840604
Native / Ahead of Time
It means you're skipping the whole bytecode business and just compiling C# straight to machine code, just like you would with a C or C++ compiler.
Anonymous
7/9/2025, 8:38:14 AM No.105845573
>>105837550
>Benchmarksgame
I want to decapitate and dismember the people who make and reference benchmarksgame. Their code samples are absolutely retarded, some use SIMD, some don't, some are idiomatic, some aren't. You can't rely on it to properly measure anything except how autistic the various programming communities that contribute to benchmarksgame are (where faster = more autistic, of course).
Replies: >>105847112
Anonymous
7/9/2025, 11:08:47 AM No.105846288
>>105837500 (OP)
> few weaknesses of oop
> few
OOP is the worst thing to happen since the invention of the computer.
Replies: >>105847293
Anonymous
7/9/2025, 12:24:43 PM No.105846741
>>105837500 (OP)
if you look at early C, its design goals are in concordance with the hardware, abstracted enough to be useful , but close enough to the hardware that the compiler doesnt have to do too much guessing, its not surprising its like that, since you were compiling code for <10mhz cpus. and it didnt hold your hand, you had to know the cpu your programming for to get the best performance. and lastly gcc has had 38 years of improvments, so it really cant be that surprising that the compiler is really good at optimizing vs newer languages.
Anonymous
7/9/2025, 1:29:26 PM No.105847112
>>105845573
Feel free to submit better solutions so your favourite lang will not look that bad.
Anonymous
7/9/2025, 2:02:17 PM No.105847293
>>105846288
Based
Anonymous
7/9/2025, 2:09:47 PM No.105847346
>>105837550
>Go has the same speed than Java AOT.
lmao, how is Golang dogshit slow?
Gofags btfo, curry sirs win again. Enjoy your spartan ass featureless language.