arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2209.09127cs.PLcs.PF
收藏

Rust C++-快吗?在日常工作中对系统语言进行基准测试

Is Rust C++-fast? Benchmarking System Languages on Everyday Routines

Nikolay Ivanov

摘要:

Rust是一种相对较新的系统程序设计语言,在过去的10年里得到了迅速的采用。Rust包含了一个在编译时强制执行的内存所有权模型。由于该模型涉及零运行时开销,因此用Rust编写的程序不仅内存安全,而且速度快,导致性能与C和C++相当。多个现有的基准测试将Rust的性能与其他语言进行了比较,这些测试集中在很少使用的表面算法上,导致了一些不确定的结果。在这项工作中,我们使用常用的算法和数据结构,而不是外来的,进行Rust和C++的比较性能基准测试。我们的评估表明,Rust的整体性能与C++相似,只有轻微的缺点。我们还证明了在某些Rust例程中,它比C++的例程稍快。

英文摘要:

Rust is a relatively new system programming language that has been experiencing a rapid adoption in the past 10 years. Rust incorporates a memory ownership model enforced at a compile time. Since this model involves zero runtime overhead, programs written in Rust are not only memory-safe but also fast, leading to performance comparable to C and C++. Multiple existing benchmarks comparing the performance of Rust with other languages focus on rarely used superficial algorithms, leading to somewhat inconclusive results. In this work, we conduct a comparative performance benchmark of Rust and C++ using commonly used algorithms and data structures rather than exotic ones. Our evaluation shows that the overall performance of Rust is similar to C++, with only minor disadvantage. We also demonstrate that in some Rust routines are slightly faster than the ones of C++.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑