3 ms·
As an example the other day I was writing low level protocol code in F# (but could do the same in C#), allocating a decent byte array on the stack (stackalloc),
by akra 5y ago
As an example the other day I was writing low level protocol code in F# (but could do the same in C#), allocating a decent byte array on the stack (stackalloc), putting value types in it, bit-shifting and putting those numbers in place in the same byte array without a single heap allocation nor a single unsafe block of code or needing other techniques like byte array pooling. In previous days the only choice often was jumping into C/C++ and writing extern functions that usually had an associated penalty especially in hot loops where we want to employ this style of coding. Made me realize how far the .NET Core ecosystem has come in the last few years. When having to go back to Java I do see the performance penalties that I didn't see many years ago.
And yes this code is all going to be hosted in containerized Linux infrastructure. Our tests showed much better single and multi-threaded performance for our cases than many other popular frameworks across many languages we evaluated. YMMV but IMO the ecosystem has made up a lot of ground in a small space of time.