如何.NET /单声道性能比较JVM? [英] How does .NET/Mono performance compare to JVM?

查看:169
本文介绍了如何.NET /单声道性能比较JVM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在想了一会儿。请给定量数据来支持你的答案。

I've been wondering this for a while. Please give quantitative data to support your answer.

相关报道:有没有在Windows,Mac和Linux JVM性能之间的显著差异

Related: Is there a significant difference between Windows, Mac, and linux JVM performance?

推荐答案

修道做比较并释放源$ C $下像LINPACK,Scimark等微基准。

Shudo has done comparisons and releases source code for microbenchmarks like linpack, Scimark, etc.

样品结果LINPACK:

Sample results for linpack:

但最后一次更新是在5年前 - 显然使用.NET V1.0或V1.1,并且大多采用JVM V1.4。这意味着它是几个版本过时的Java和.NET的。你可以得到源代码,并生成自己的结果。

But the last update was over 5 years ago - apparently using .NET V1.0 or v1.1, and mostly using JVM v1.4. Which means it is several releases out of date on both Java and .NET. You could get the source and generate your own results.


我只是做了这一点 - 下载linpack.java和linpack.cs,编译和运行它们。我使用的Sun Java v1.6.0.11,和C#3.0(3.5编译器)来自微软。无论在Windows Vista上。

I just did this - downloaded linpack.java and linpack.cs, compiled and ran them. I used Java v1.6.0.11 from Sun, and C# 3.0 (3.5 compiler) from Microsoft. Both on Windows Vista.

有关2000的LINPACK问题大小,我得到了17.6s的Java版本,17.78s对于C#版本。

For a linpack problem size of 2000, I got 17.6s for the Java version, 17.78s for the C# version.

然后,我又跑了,并得到了18.14s的Java和17.31为C#。

Then I ran it again and got 18.14s for Java, and 17.31 for C#.


这说明了在性能测量和测试一些挑战。

This illustrates some challenges in performance measurement and testing.

  • 第一:
    审单不足以得出有意义的结论。通常你应该测量大量的试验,然后取平均值。

  • First:
    a single trial is not enough to draw meaningful conclusions. Usually you should measure lots of trials, and then average the results.

二:
只是你这是衡量?如果运行解决单个问题的单个试验中,然后在启动过程的成本包含在时间,以及JIT时间,任何费用来填充任何缓冲器。这可能是也可能不是你真正想要测量。

Second:
just what are you measuring? If you run a single trial of solving a single problem, then the cost of starting the process is included in the time, as well as JIT time, and any cost to fill any buffers. This may or may not be what you really want to measure.

在许多情况下,它是稳定状态PERF要测量。例如,在一个服务器进程,则一旦启动它,它运行数月。因此,启动成本可以忽略不计,而且要衡量和优化,什么是请求吞吐量给出的最低平均响应时间。或者在胖客户端,你想要的是做视频处理所需的时间,你不想来衡量过程的启动成本。

In many cases it is the steady-state perf you want to measure. For example in a server process, you start it once and it runs for months. Therefore the startup cost is negligible, and what you want to measure and optimize for is request throughput given a minimum average response time. Or in a "Fat Client", what you want is the time required to do video processing, and you don't want to measure process startup costs.

三:
什么是工作量?如果你做大量的浮点运算的Linpack和Scimark可能是有趣的。但是,如果你做的是什么呢?如果你做大量的XML粉碎,或字符串分析,或整数运算,或者数据库交互,或HTML页面生成的。如果你的code做大量的线程管理的,或者使用线程同步原语?那么通信和IO?如果交易的一个关键部分是加密或数字签名创建和验证?这些基准不会告诉你关于其他情况下任何东西。出于这个原因,你可以打电话给他们的微基准。

Third:
what is the workload? Linpack and Scimark might be interesting if you do lots of floating point math. But what if you don't? What if you do lots of XML shredding, or string parsing, or integer math, or database interaction, or HTML page generation. What if your code does lots of thread management, or uses thread-synchronization primitives? What about communications and IO? What if a key portion of a transaction is encryption, or digital signature creation and verification? These benchmarks won't tell you anything about those other scenarios. For that reason you might call them micro-benchmarks.

您需要一个正确的模型,你要评估哪些基准。

You need a benchmark that correctly models what you want to evaluate.


另请参阅:
<一href="http://stackoverflow.com/questions/718011/trivial-mathematical-problems-as-language-benchmarks/718019#718019">Trivial数学问题作为语文基准

See also:
Trivial mathematical problems as language benchmarks

这篇关于如何.NET /单声道性能比较JVM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆