← Home ← Back to /g/

Thread 105837500

57 posts 8 images /g/
Anonymous No.105837500 [Report] >>105837510 >>105837543 >>105837789 >>105837822 >>105837868 >>105840215 >>105840672 >>105841032 >>105842186 >>105844601 >>105845548 >>105846288 >>105846741
Is this the reason why C++ and Rust are so much slower than C, Hare, Zig, Odin ...?
Anonymous No.105837510 [Report] >>105840487
>>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.
Anonymous No.105837543 [Report] >>105840215
>>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.
Anonymous No.105837550 [Report] >>105837602 >>105840604 >>105844601 >>105845573 >>105847346
Anonymous No.105837557 [Report] >>105837584 >>105840215
rust is slower because the gender borrower needs time to check your transition from an unsafe gender to a safe gender
Anonymous No.105837584 [Report] >>105837596
>>105837557
>see technology
>instantly think about sexual degeneracy
What made cniles like this?
Anonymous No.105837596 [Report] >>105837617
>>105837584
what a roundabout way of admitting you have indeed not seen this technology
Anonymous No.105837602 [Report]
>>105837550

I'm proud of C#
Anonymous No.105837617 [Report] >>105837892
>>105837596
I have been programming for like 15 years.
Anonymous No.105837789 [Report] >>105838302
>>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
Anonymous No.105837822 [Report]
>>105837500 (OP)
No. Whoever is posting that is retarded.
Anonymous No.105837868 [Report]
>>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 No.105837883 [Report] >>105837887
if op is wrong then why rust so slow
Anonymous No.105837887 [Report] >>105837899
>>105837883
Post benchmark
Anonymous No.105837892 [Report]
>>105837617
irrelevant
Anonymous No.105837899 [Report]
>>105837887
>c fast
>rust slow
explain this
Anonymous No.105838302 [Report] >>105838344
>>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"
Anonymous No.105838344 [Report]
>>105838302
NTA
Learning bunch of buzzwords will not automatically make your argument valid.
Anonymous No.105840215 [Report] >>105840561 >>105840659
>>105837500 (OP)
>>105837543
>>105837557
lol these retards actually think "rust slow"
Anonymous No.105840487 [Report] >>105840535
>>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.
Anonymous No.105840535 [Report] >>105840699
>>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.
Anonymous No.105840561 [Report]
>>105840215
yes
Anonymous No.105840604 [Report] >>105840692 >>105845548
>>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.
Anonymous No.105840659 [Report] >>105840684
>>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.
Anonymous No.105840672 [Report]
>>105837500 (OP)
Because they spam the heap like a bunch of illiterate web devs.
Anonymous No.105840684 [Report]
>>105840659
the bororw cehcker forces heap suage
Anonymous No.105840692 [Report] >>105840795
>>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.
Anonymous No.105840699 [Report]
>>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 No.105840795 [Report]
>>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 No.105841032 [Report]
>>105837500 (OP)
Rust is not an object oriented language, it’s faster.
Anonymous No.105842186 [Report]
>>105837500 (OP)
It's not, but many people who write C++/Rust are not cognizant of stack/heap usage compared to C programmers
Anonymous No.105844601 [Report] >>105845338
>>105837500 (OP)
Based. POOP is like ORM for the memory

>>105837550
Another day another total humiliation of gotards
Anonymous No.105845119 [Report] >>105845228
Does C put things on the stack that C++ and Rust put in the heap?
Anonymous No.105845228 [Report] >>105845340 >>105845384
>>105845119
The post is referring to spatial locality but eveyone itt talking about heap allocation.
Anonymous No.105845338 [Report]
>>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 No.105845340 [Report] >>105845382
>>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
Anonymous No.105845363 [Report] >>105845371
Are we talking about struct of arrays again?
Anonymous No.105845371 [Report]
>>105845363
no
if you have nothing to add, why do you take part in the discussion?
Anonymous No.105845382 [Report] >>105845434
>>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.
Anonymous No.105845384 [Report] >>105845420
>>105845228
So in C are functions stored differently than class methods in a way that caches better?
Anonymous No.105845420 [Report] >>105845426 >>105845444
>>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.
Anonymous No.105845426 [Report]
>>105845420
I meant multiple inheritances in C++.
Anonymous No.105845434 [Report] >>105845471
>>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?
Anonymous No.105845444 [Report] >>105845454 >>105845482
>>105845420
C won’t have multiple inheritance, lambdas, generics until C26
Anonymous No.105845454 [Report]
>>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 No.105845471 [Report] >>105845502
>>105845434
My point was that people itt thread are ignoring the orignal post.
Anonymous No.105845482 [Report]
>>105845444
I meant to say C++. C23 still doesn't have lsp support. I don't think anyome cares about nu C.
Anonymous No.105845502 [Report]
>>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 No.105845511 [Report] >>105845519
I'm confused.
Is OP trying to say that an object's methods live alongside the object in memory?
Anonymous No.105845519 [Report]
>>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 No.105845548 [Report]
>>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 No.105845573 [Report] >>105847112
>>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).
Anonymous No.105846288 [Report] >>105847293
>>105837500 (OP)
> few weaknesses of oop
> few
OOP is the worst thing to happen since the invention of the computer.
Anonymous No.105846741 [Report]
>>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 No.105847112 [Report]
>>105845573
Feel free to submit better solutions so your favourite lang will not look that bad.
Anonymous No.105847293 [Report]
>>105846288
Based
Anonymous No.105847346 [Report]
>>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.