如何为单声道虚拟机目前的表现?何为、虚拟机、单声道、目前

2023-09-03 11:13:12 作者:想去你心里玩玩

该网站是完全不同的两种不同的语言,编译器和虚拟机的性能测试的。然而,几乎没有使用真实世界的场景中任何一个测试性能。此外,谷歌搜索这类标准通常产生主要仅有数年历史的基准为那些有过最长时间来收集它们的链接。

The web is full of different kinds of performance test of different languages, compilers, and virtual machines. Yet hardly any of these test the performance using some real-world scenario. In addition, searching Google for these kind of benchmarks usually yields mainly only several years-old benchmarks as those have had the most time to gather links to them.

做任何你有一些真正见识到不同的虚拟机目前的表现?另外我特别想知道如何单声道的表现比较那些微软的.Net和Sun的Java,以及如何不同的虚拟机的性能已经进化最近。

Do any of you have some real insight into the current performance of different virtual machines? In addition I'd especially like to know how Mono's performance compares to those of Microsoft's .Net and Sun's Java and how the performance of different virtual machines has evolved lately.

推荐答案

衡量性能是一个复杂的问题。在过去,当语言被测试对相同的操作系统,运行相同的硬件和一组库有可能创建的基准,可以给将测量的系统中的线性量度的非常有限。这将让人们评价事物从0到10,吸收的结果,并迅速转移到下一个主题。

Measuring performance is a complicated matter. In the past, when languages were tested against the same operating system, running the same hardware and a very limited set of libraries it was possible to create benchmarks that could give a linear metric that would measure a system. It would let folks evaluate things from zero to ten, assimilate the result and move on quickly to the next subject.

事情已经变得更加复杂,现代的系统,有多个变量以考虑。

Things have become more complicated with modern systems as there are multiple variables to take into account.

至少在Mono的情况下,有大量的变量在起作用:

At least in Mono's case there are plenty of variables that come into play:

code:

Code: 的本土code的质量产生的。 在其中产生本土code的速度。 来产生code和优化code 所需的内存 是code生成的多线程 是生成的code线程安全 在是否利用CPU的具体特点,在编译或JIT的时间。 在它可以使用SIMD指令(如果可用)。 请问语言地图本身整齐多核平台 是否语言的optimizier调整提供了足够的参数,你的code自动(如Fortran一样)。 The quality of the native code generated. The speed at which the native code is generated. The memory required to generate the code and to optimize the code Is the code generator multi-threaded Is the generated code thread-safe Does it take advantage of CPU specific features, at compile time or JIT time. Can it use SIMD instructions if available. Does the language map itself neatly to multi-core platforms Does the language provide enough parameters for an optimizier to tune your code automatically (Like Fortran does).

内存管理:

在所使用的垃圾收集算法 是否GC规模具有多个CPU? 是GC增量或实时? 在它支持线程本地存储来提高性能?​​ 在它是precise,压实,辈分,保守,各有什么混音。

API设计的:

是专为延迟或带宽的API 请API的支持自动扩展到多个CPU。 您可以卸载重型工作提高到一个GPU? 请您的API支持流媒体接口

所有这些事情使问题复杂化非常多,做一个简单的0至10的回答很辛苦付出。

All of these things complicate matters very much and make a simple 0 to 10 answer very hard to give.

如果你要分区类语言,并承担主管和性能了解的程序员,我会瓜分世界的这些类:

If you were to partition languages in classes, and you assume a competent and performance aware programmer, I would divide the world in these classes:

第1层:由专业手动调整汇编语言 第2层:静态编译,强类型语言:C / C ++ / Fortran的/ 在第3层:管理/ JIT语言:用Java / C#/。NET /黑白/ BOO / F# 在第4层:动态类型/ JIT编译的语言:谷歌的V8,IronPython的,IronRuby的 5级:纯跨preTED语言:Python和Perl的 在第6层:纯跨preTED语言,有太多的功能对自己的好 Tier 1: Hand tuned assembly language by a professional Tier 2: Statically compiled, strongly typed languages: C/C++/Fortran/ Tier 3: managed/JIT languages: Java/C#/.NET/Mono/Boo/F# Tier 4: dynamically typed/JITed languages: Google V8, IronPython, IronRuby Tier 5: pure interpreted languages: Python, Perl Tier 6: pure interpreted languages, with too many features for their own good.

但语言不画一个完整的画面,你会消耗的API,托管操作系统和其他设施,将会对你的结果有很大的影响。

But the languages do not paint an entire picture, the APIs that you will consume, the hosting operating system and other facilities will have a big impact on your results.

例如,最近在单声道,我们增加了一个更先进的,高度优化的引擎(LLVM的引擎)更换Mono的code代引擎支持。事实证明,这是令人难以置信的很难找到一个测试,使用LLVM的开销是值得的额外内存使用:桌面和Web应用程序并没有表现出多大的差别。这可能是由于这样的事实,这些大多是I / O绑定的应用程序。

For example, recently in Mono we added support for replacing Mono's code gen engine with a more advanced, highly optimizing engine (the LLVM engine). It turns out that it was incredibly hard to find a test where the overhead of using LLVM was worth the extra memory use: desktop and web applications did not exhibit much of a difference. And this is probably due to the fact that these are mostly I/O bound applications.

使用LLVM是用于科学和计算密集型应用程序,但在现实生活中它并没有太大的Mono的默认优化设置的差异。

Using LLVM was useful for scientific and computationally intensive applications, but in real life it did not make much of a difference from Mono's default optimization settings.

对于单声道的细节:虽然单确实使用贝姆的GC,大多数人不知道的是,贝姆可以以多种方式进行配置。默认外行的配置确实不是很强大,但它适用于每个人想要快速GC。单不在此模式下使用勃姆,单声道配置勃姆广泛地$ p中$ pcise模式以及利用线程局部存储器,多核GC和释放-存储器到所述-OS模式工作。

As for the specifics of Mono: although Mono does use Boehm's GC, what most folks do not realize is that Boehm can be configured in various ways. The default layman configuration is indeed not very powerful, but it works for everyone that wants a quick GC. Mono does not use Boehm in this mode, Mono configures Boehm extensively to work in precise-mode as well taking advantage of thread local storage, multi-core GC and release-memory-to-the-OS modes.