3 ms·
Good point, but unsafe code works just fine without compiling to native in the first place. JIT CIL unsafe code would probably perform identically to compiled c
by RyanZAG 14y ago
Good point, but unsafe code works just fine without compiling to native in the first place. JIT CIL unsafe code would probably perform identically to compiled code, as you'd only use unsafe code inside tight loops anyway - and the JIT will have compiled it to native on/before the first pass through.
- pjmlp 14y agoI got a bit confused by your statement. CIL is always compiled to native code, either via JIT or AOT (ngen, mono -aot).
- RyanZAG 14y agoThat's right - I was addressing the issue where people think that they will turn C# into C++ by allowing for 'native compile'. In the cases where you use normal C#, compiling to native isn't going to make your code run as fast as C++ as you still have bounds checking, garbage collection, etc. In the case where you use unsafe C# code inside a loop, it's going to be running as native code anyway once the JIT runs through it. ie. This story is terribly misguided as it seems to imply that C# is changing into something else because of a few compiler changes...
- pjmlp 14y agoOk