Loop Recognition in C++/Java/Go/Scala

Loop Recognition in C++/Java/Go/Scala
复制标题

C /Java/Go/Scala 中的循环识别

DOI:
--
复制
发表时间:
2011
期刊:
影响因子:
--
通讯作者:
R. Hundt
R. Hundt
中科院分区:
--
文献类型:
--
作者:
R. Hundt

文献摘要

被引文献

相似文献

在这份经验报告中,我们用四种编程语言(即C++,Java,Go和Scala)编码了一个指定的紧凑基准。每个实现都使用语言的惯用容器类、循环构造和内存/对象分配方案。它不试图利用特定的语言和运行时特性来实现最大性能。这种方法允许对语言特性、代码复杂性、编译器和编译时间、二进制大小、运行时间和内存占用进行几乎公平的比较。虽然基准本身简单紧凑,但它采用了许多语言功能,特别是高级数据结构(列表,映射,列表和集合和列表的数组),一些算法(union/find,dfs / deep recursion和基于Tarjan的循环识别),集合类型的迭代,一些面向对象的功能和有趣的内存分配模式。我们不探讨多线程的任何方面,或更高级别的类型机制,这在语言之间有很大的差异。基准测试指出,在语言实现的所有检查维度中存在非常大的差异。在Google内部发布基准测试之后,几位工程师制作了高度优化的基准测试版本。我们描述了许多已执行的优化,这些优化主要针对运行时性能和代码复杂性。虽然这只是一个比较,但基准测试和后续的调优工作表明了相应语言中的典型性能痛点。
In this experience report we encode a well specified, compact benchmark in four programming languages, namely C++, Java, Go, and Scala. The implementations each use the languages’ idiomatic container classes, looping constructs, and memory/object allocation schemes. It does not attempt to exploit specific language and run-time features to achieve maximum performance. This approach allows an almost fair comparison of language features, code complexity, compilers and compile time, binary sizes, run-times, and memory footprint. While the benchmark itself is simple and compact, it employs many language features, in particular, higher-level data structures (lists, maps, lists and arrays of sets and lists), a few algorithms (union/find, dfs / deep recursion, and loop recognition based on Tarjan), iterations over collection types, some object oriented features, and interesting memory allocation patterns. We do not explore any aspects of multi-threading, or higher level type mechanisms, which vary greatly between the languages. The benchmark points to very large differences in all examined dimensions of the language implementations. After publication of the benchmark internally at Google, several engineers produced highly optimized versions of the benchmark. We describe many of the performed optimizations, which were mostly targeting runtime performance and code complexity. While this effort is an anecdotal comparison only, the benchmark, and the subsequent tuning efforts, are indicative of typical performance pain points in the respective languages.