C# vs C - Big performance difference

前端 未结 13 594
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-28 01:39

I\'m finding massive performance differences between similar code in C anc C#.

The C code is:

#include 
#include 
#inclu         


        
13条回答
  •  爱一瞬间的悲伤
    2020-11-28 02:37

    The other factor that may be an issue here is that the C compiler compiles to generic native code for the processor family you target, whereas the MSIL generated when you compiled the C# code is then JIT compiled to target the exact processor you have complete with any optimisations that may be possible. So the native code generated from the C# may be considerably faster than the C.

提交回复
热议问题