News for hackers. Stuff that matters.
Re:Introducing .NET IL Linker by Nuzzerino on Wednesday August 30, 2017 @06:26PM (#15136627)
Using things like stackalloc, malloc, and local-only references, It is possible to implement algorithms in C# which can run at blazing-fast speeds, sometimes hundreds of times faster than idiomatic C#. C#-style arrays would not make the cut.

The optimal thing to do would be to memcpy several KB of data at a time from your heap-based memory, into your stack-allocated memory, do your processing in the optimized inner-loop, then commit the data back to the heap. I had to do this once to increase the throughout of a cluster of image processing servers.

I often scoff at the idea that C# isn't a good choice for performance-intensive tasks.

Re:Introducing .NET IL Linker by alkonaut on Wednesday August 30, 2017 @06:41PM (#15136734)
At some point however, the C# becomes so in-idiomatic or convoluted that it's just C in C# clothing. So one always needs to ask if it's time to just offload a task to a native library. It's convenient to have a single toolchain and not mess with a native toolchain though.
Re:Introducing .NET IL Linker by ygra on Thursday August 31, 2017 @01:13AM (#15138301)
Especially since with native you're giving up AnyCPU, unless compiling the native parts for every platform you care about. I'd also argue that even unidiomatic C#'s semantics are less prone to UB than switching to C.