3 ms·
> C# is ~ 4.5x faster on a single-threaded burst allocation test. It certainly makes sense for Go to trade off allocation performance for latency--Go employs v
by throwaway894345 6y ago
> C# is ~ 4.5x faster on a single-threaded burst allocation test.
It certainly makes sense for Go to trade off allocation performance for latency--Go employs value types and stack allocation more frequently/idiomatically than C# and as a consequence it enjoys low, constant-time STW pauses. It would actually be pretty interesting if C# made the same tradeoff--it might make C# use value types more frequently/idiomatically as well. IIRC, this would probably drive less inheritance and more composition since I believe value types can't be inherited. You might end up with C# code that looks more like Go?