英文:
GraalVM performance
问题
我们正在评估GraalVM是否适用于我们的堆栈。
其中一个重要考虑因素是性能,这里有一些基准测试:https://renaissance.dev/。
问题是我们想要看到与其他语言实现之间的基准测试,而不是OpenJDK和GraalVM版本之间的对比。
我唯一找到的是在这篇文章中将其与C2进行比较:https://medium.com/graalvm/graalvm-20-1-7ce7e89f066b
我们的谷歌搜索没有找到其他信息。
在哪里可以找到更多广泛的、跨语言的GraalVM基准测试?
英文:
We are evaluating GraalVM for our stack.
One of the major considerations is performance, and there are some benchmarks here: https://renaissance.dev/.
The problem is that we want to see benchmarks to implementations in other languages, not between OpenJDK and GraalVM versions.
The only I could find is in this article comparing it to C2. https://medium.com/graalvm/graalvm-20-1-7ce7e89f066b
Our google search turned up nothing else.
Where could we find more extensive, cross-language benchmarks of GraalVM?
答案1
得分: 6
这实际上是一个非常复杂的问题。它在很大程度上取决于工作负载、编程语言等因素。
相比较而言,比较相同编程语言的不同实现要简单一些。例如,Renaissance 套件 就是针对 Java 进行这样的比较。
最近有一个关于 Ruby 的演示,在一些 Web 应用基准测试中比较了 TruffleRuby 与 CRuby 的性能差异。
对于 JavaScript 来说,如果我们看 Graal.js 与 V8,有一个特别需要注意的地方是 Graal.js 的启动时间较长,而且差距相当大。目前,你需要相当长的时间来热身代码,有时需要几分钟。GraalVM 团队正在努力改进启动时间,但可能仍然需要一些预热。
总体而言,在我们的基准测试中,热身后的性能与 V8 差不多,通常会稍微慢一些。
如果你特别关注 Web 应用方面,不仅可以看 Node.js 应用,还可以看看 es4x 项目。
为什么我提到这个项目呢?因为例如 TechEmpower 基准测试会通过让条目实现预定义的 Web 应用程序,并在多种场景下进行测试来模拟真实世界的情况,然后根据编程语言给出结果。这里是最新的结果,已经按 JavaScript 进行了过滤: https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=composite&l=zik0sf-1r
es4x 的分数要好得多,几乎是 2 倍,而且他们的提交是在 GraalVM 上运行的,可以查看他们提交的 Docker 文件。
我不知道是否有直接比较 GraalVM 本机镜像应用与 Node.js 或 C/C++ 的情况(尽管我想与 C++ 相比较,golang 可能会更有趣)。启动时间和内存消耗肯定是可以比较的:启动时间在几十到几百毫秒之间,可以在 128/256M 的环境中舒适运行。
英文:
It's a very complex question to be honest. It heavily depends on the workload, the language, etc.
Comparing implementations of the same language is kind of simple in comparison. For example, the Renaissance suite does that for Java.
There's a very recent presentation about Ruby, comparing TruffleRuby to CRuby on some web application benchmarks.
For JavaScript, if we look at Graal.js vs V8. One particular thing to note is that Graal.js has longer startup times. As in significantly longer. Currently you need to warm up the code quite a bit, sometimes minutes. The GraalVM team is working on improving startup, but some warmup will most probably be still needed.
In general, on our benchmarks performance after warmup is sort of comparable to V8, usually a bit slower.
If you want that particularly in the context of web applications, you can look not only on node.js apps, but for example es4x project.
Why I'm bringing that up, because for example the TechEmpower benchmarks that simulate real world scenarios by making the entries implement a predefined web-application with a database access and test it on several scenarios, have the results by languages. Here's the latest results filtered by JavaScript: https://www.techempower.com/benchmarks/#section=data-r19&hw=ph&test=composite&l=zik0sf-1r
Es4x's score is better by almost 2x, and their submission does run on GraalVM, see the docker file for their submission
I don't know of any direct comparisons between GraalVM native image apps vs. node.js or C/C++ (though I'd imagine golang would be more interesting than c++ to compare to). The startup time & memory consumption would definitely be comparable: starting in a few dozen/hundred milliseconds, comfortably running in 128/256M environments.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论