Skip to content

yzhang71/Rust_C_Benchmarks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust and C Benchmarks

Overview

Rust is a statically-typed programming language developed for efficiency and safety, particularly in concurrency and memory safety. The popularity of Rust programming has increased over the last couple years because it was claimed to provide comparable speed to C/C++. This repository collect 22 macro benchmarks and 10 performance benchmarks that are both implemented in Rust and C from open-sourced third-parties to compare the run-time performance objectively.

Building Environment

Rustc and llvm arre supported by different Ubuntu versions. For reproductive experiments, we recommend you to build them on Ubuntu 18.04 LTS 64bit.

Build Vanilla rust-1.61.0 from source code

$ git clone https://github.com/rust-lang/rust.git
$ cd rust
$ cp config.toml.example config.toml
$ ./x.py build && ./x.py install

To build and install Cargo, you may run ./x.py install cargo or set the build.extended key in config.toml to true to build and install all tools.

Build Modified rust-1.61.0 from source code (in this repository)

$ cd rust-1.61.0-modified
$ cp config.toml.example config.toml
$ ./x.py build && ./x.py install

Download Vanilla LLVM-14.0.0

It can be downloaded and installed from [here].

Test Cases

For more details, please refer to Section III "Performance Comparison: Rust v.s. C" in our paper.

Please refer to the relevant README under the Benchmarks path.

Please note the credit goes to:

New Findings

We discovered several new factors that influence Rust run-time performance. Click here to view.

References