Similar Posts

Subscribe
Notify of
9 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Erzesel
1 year ago

As with all, you should consider at what point “performance” is necessary.

If I have to do any work on the file system, it would be complete nonsense to start VS and set up a C++ project.

I’ll do this with a line of Powershell… Then the performance is already in the letter of the “Programme”.

If you’re not just 5 billion. Calculate positions of PI (or do some super time-critical things), C# or Java is an acceptable compromise.

As with the above extreme example with Powershell, besides the “Nettoperformace” one should also keep an eye on the time required for development. It makes little sense to spend a couple of hours on a C solution when C# already offers a finished class.

…and of course you can program time-critical routines as native (unmanaged) code with C++ or even assembler and call C#.

And the following goes…

… it doesn’t matter if the “framework program” was written in C++ or C#

Rust could most probably be called Formula1 cars with airbags and beverage holders and child seat.

BorisG2011
1 year ago

Learning Rust is worth considering. I do not necessarily think of performance – this is not bad at all at Rust – but rather of the form of storage management implemented in Rust, which offers much better safety properties compared to what we have in C for almost 50 years.

Palladin007
1 year ago

I know you can’t compare it like that

Right, you can’t.

So if you look at the very general basic execution speed, C and C++ should be roughly the same as both provide approximately the same result. C# is a bit slower because a runtime hangs in between, which does even more. Where Rust is, I don’t know.

However, the most performance problems at a distance are due to incorrect/next use of voice functions or frameworks. C++ likes to be used for high-performance applications, but it happens easily that you misuse it and create more performance problems than you solve. C#, on the other hand, is much simpler, which offers less such falling knits, but you can’t optimise as small as with C++ – but should be really relevant for the fewest projects.

If it really is about maximum performance, but you don’t want to have the additional risks of C/C++, I would combine C# and C++. C# as a “main language” for the actual application and the hot path (e.g. elaborate mathematical calculations) in C++, since C++ libraries can be called out quite simply from C#.

daCypher
1 year ago

If it’s really important to get the last pairing speed out, C# might be a little slower than the others. C# is not compiled in the native processor code, but is executed in the .NET Runtime, which compils the code only to the end when it is executed.

For this, C# is much more pleasant to program than C or C++, because you don’t have to make sure that you pass any variables as a pointer or release any memory, etc. With Rust I don’t have enough experience to tell you about it. As far as I know, Rust is supposed to solve the problems of C and C++ without being slower.

Palladin007
1 year ago
Reply to  daCypher

C# is not compiled in the native processor code, but is executed in the .NET Runtime, which compils the code only to the end when it is executed.

Not necessarily, there are also Native AOT.
However, this should still be a little behind.

MonkeyKing
1 year ago

Basically, all compiler languages are, so they should not differ significantly in speed. That is, the code is converted into machine code, it is not faster.

Rust is a modern language and certainly interesting, but you don’t have to know it. Depends on what you do. Of the languages I would most recommend C# because most widely used.

jo135
1 year ago
Reply to  MonkeyKing

C# recommend because most widely used

Seriously?

Palladin007
1 year ago
Reply to  jo135

Compared to Rust, that’s true.