什么是“语言表现”?

发布于 2024-08-21 17:55:04 字数 50 浏览 4 评论 0原文

我正在阅读一个比较不同编程语言的演示文稿。测量的特征之一是“语言表现”。这是什么意思?

I'm reading a presentation in which different programming languages are being compared. And one of characteristics which is measured is 'Language Performance'. What does it mean?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

来世叙缘 2024-08-28 17:55:04

真正的答案是:这没有任何意义,或者无论该演示文稿的作者当时在想什么。

也许这意味着“相对于其他语言,执行具有相同语义的操作需要多少时间”?但谁能说呢?

The real answer: it means nothing, or whatever the author of that presentation was thinking about at the time.

Maybe it means "how much time it takes to perform actions with the same semantics relative to other languages"? But who can say?

漆黑的白昼 2024-08-28 17:55:04

我将语言性能定义为在提供典型的、惯用的算法实现时,现有的最佳语言实现的性能。

有些语言比其他语言更容易编写高效的实现。例如,C 基本上一直是一种“快速”语言,因为它非常接近金属并且易于为其编写高效的编译器。由于性能在技术上是实现的一个属性,因此随着实现的改进,慢速语言可以变成快速语言。例如,Java 在其早期版本中被解释为(在当时是正确的)一种“慢”语言。从那时起,JIT 编译器和垃圾收集器变得如此出色,以至于 Java 现在理所应当地在“快速”语言中占有一席之地。这说明了为什么需要对语言性能的这种比较持保留态度。

I would define language performance as meaning the performance of the best existing implementations of a language when provided with typical, idiomatic implementations of algorithms.

Some languages are much easier to write efficient implementations of than others. C, for example, has basically always been a "fast" language because it's very close to the metal and easy to write an efficient compiler for. As performance is technically a property of the implementation, a slow language can become a fast language as implementations improve. Java, for example, was interpreted in its early versions and was considered (rightly at the time) to be a "slow" language. Since then, the JIT compilers and garbage collectors have gotten so good that Java now rightfully deserves a place among "fast" languages. This illustrates why such comparisons of language performance need to be taken with a grain of salt.

乖乖 2024-08-28 17:55:04

这是一个负载性问题,绝对需要解释。如果这是一篇高质量的论文,它应该准确说明他们是如何测量的,以便读者可以对数字的有效性做出自己的判断。但我的衡量方式是:

我会创建/找到一系列执行完全相同操作的程序,并且可以用每种语言以非常接近相同的方式编写。可能已经存在一套软件(la SPEC cpu2006)可以做到这一点。找到这些程序后,我会运行它们并测量性能。在这里,仍然很难得出结论,因为不同的语言(和/或运行时)做得更好或更差,并且很难找到一组“正确”运用所研究语言的所有部分的程序。

This is a loaded question and is definitely up for interpretation. If this is a high quality paper, it should should specify exactly how they measured it so the reader can make their own judgment on the validity of the numbers. How I would measure it though is:

I would create/find a series of programs that do exactly the same thing and can be written in very close to the same way in every language. It's possible there already exists a suite of software (a la SPEC cpu2006) that does exactly that. After finding these programs, I'd run them and measure the performance. Here, it's still hard to draw conclusions, as different languages (and/or runtimes) do different things better and worse, and it's very difficult to find a set of programs that "correctly" exercise all parts of the studied languages.

只是一片海 2024-08-28 17:55:04

通常这意味着作者更喜欢正在讨论的其中一种语言,并试图让您相信他的偏好是有效的,并且基于可靠的事实,而不是个人品味(或者可以说,缺乏个人品味)。

Usually it means that the author prefers one of the languages being discussed, and is attempting to convince you that his preference is valid and based on solid facts rather than personal taste (or, arguably, lack thereof).

甲如呢乙后呢 2024-08-28 17:55:04

据我所知,这不是一个具有普遍公认定义的术语。实际上。 “语言表现”可能意味着“我最喜欢的语言得分很高的一些指标”。更重要的是,演示文稿应该定义术语。如果这个术语没有以易于理解的方式定义,那么演示就缺乏实质内容。

It's not, as far as I know, a term with a universally acknowledged definition. In fact. "Language Performance" probably means "some metric for which my favorite language has a good score". More seriously, the presentation should define the terms. If this term isn't defined in a comprehensible fashion, then the presentation lacks substance.

流心雨 2024-08-28 17:55:04

有些语言需要很大的运行环境才能正常运行,这主要适用于Python或Ruby等解释性语言。许多编译语言的运行时开销较小,例如 Objective-C。这些因素都会影响绩效。

Some languages require large runtime environments in order to run properly, this mainly applies to interpreted languages like Python or Ruby. Many compiled languages have smaller runtime overhead, like Objective-C. These factors contribute to performance.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文