Java vs .NET performance [closed]

可紊 提交于 2019-11-30 19:31:29
FoggyDay

Any time you do any kind of benchmarking or performance analysis, you need to ask a lot of questions, and take any particular result with (to paraphrase Tanenbaum), "a metric ton of salt".

HOWEVER ....

I copied pasted your code, and this is what I got:

Compiler      Version   Timing
--------      -------   ------
MSVS 2012     C# 5      4448.0
Eclipse Luna  JRE 1.7    977.0

So the Java program ran 4.5x faster than the C# program.

I also ran the MSVS "Profiling Wizard":

https://msdn.microsoft.com/en-us/library/dd264959.aspx

Large picture

As you might be able to see from the screenshot, the "Big Pig" in this profile was ArrayTest.get_item(int32, int32), which consumed NEARLY HALF of the execution time:

Large picture
Abhishek

You can't judge the performance based on single instance. You need to do it for multiple instance. If you want concrete answers on performance I would suggest you to read quora, blog or SO.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!