Hacker News new | ask | show | jobs
by neonsunset 797 days ago
ARC and shared_ptr are net more expensive than GC, in throughput scenarios you will see that C++ often offers no meaningful performance advantage. Also Swift is significantly slower due to upfront ARC cost and defaulting to virtual dispatch in many places, more so than .NET with interface spam (Dynamic PGO takes care of it anyway).

Nulls have stopped being an issue in practical terms since you specify nullability explicitly e.g. string?/string.

C# does not need runtime installed on the host. You can produce JIT or AOT executables which include one. It also needs runtime on Windows just as much (if you don’t include it or host doesn’t have it installed). Only .NET Framework was preinstalled but no one (sane that is) chooses this legacy target for new code.

1 comments

Do you have some benchmark examples where C# beats the throughput of C++ using shared_ptr?