Why is .NET faster than C++ in this case?

后端 未结 13 1646
长发绾君心
长发绾君心 2021-02-02 00:59

Make sure you run outside of the IDE. That is key.

-edit- I LOVE SLaks comment. \"The amount of misinformation in these answers is staggering.\" :D

13条回答
  •  Happy的楠姐
    2021-02-02 01:31

    you are calling static function in c# code which will be inlined, and in c++ you use nonstatic function. i have ~1.4 sec for c++. with g++ -O3 you can have 1.21 sec.

    you just can't compare c# with c++ with badly translated code

提交回复
热议问题