Skip to content

Commit f5167da

Browse files
committed
Add Rust microbenchmark
1 parent 9c37685 commit f5167da

File tree

9 files changed

+792
-2
lines changed

9 files changed

+792
-2
lines changed

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ benchmarks/java.csv: java/src/main/java/PerfBLAS.java
125125
benchmarks/scala.csv: scala/src/main/scala/perf.scala scala/build.sbt
126126
cd scala; for t in 1 2 3 4 5; do sbt run; done >../$@
127127

128+
benchmarks/rust.csv: rust/src/main.rs rust/src/util.rs rust/Cargo.lock
129+
cd rust; for t in 1 2 3 4 5; do cargo run --release -q; done >../$@
130+
128131
BENCHMARKS = \
129132
benchmarks/c.csv \
130133
benchmarks/fortran.csv \
@@ -137,7 +140,8 @@ BENCHMARKS = \
137140
benchmarks/matlab.csv \
138141
benchmarks/octave.csv \
139142
benchmarks/python.csv \
140-
benchmarks/r.csv
143+
benchmarks/r.csv \
144+
benchmarks/rust.csv
141145

142146
# These were formerly listed in BENCHMARKS, but I can't get them to run
143147
# 2017-09-27 johnfgibson

bin/table.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
chomp(our $mathematica_ver = `echo quit | math -version | head -n 1 | cut -f2 -d" "`);
3838
#chomp(our $stata_ver = `stata -q -b version && grep version stata.log | cut -f2 -d" " && rm stata.log`);
3939
chomp(our $java_ver = `java -version 2>&1 |grep "version" | cut -f3 -d " " | cut -c 2-9`);
40+
chomp(our $rust_ver = `cd rust; rustc --version | cut -c 7- | sed 's/ ([0-9a-f]* /<br>(/g'`);
4041

4142
our %systems = (
4243
"c" => ["C" , "gcc $c_ver" ],
@@ -51,10 +52,11 @@
5152
"r" => ["R" , $R_ver ],
5253
"octave" => ["Octave" , $octave_ver ],
5354
"go" => ["Go" , $go_ver ],
55+
"rust" => ["Rust" , $rust_ver ],
5456
# "stata" => ["Stata" , $stata_ver ],
5557
);
5658

57-
our @systems = qw(c julia lua go fortran java javascript matlab mathematica python r octave);
59+
our @systems = qw(c julia lua rust go fortran java javascript matlab mathematica python r octave);
5860

5961
print qq[<!-- Table generated by the Perl script test/perf/micro/bin/table.pl in the main julia repository -->\n];
6062
print qq[<table class="benchmarks">\n];

rust/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target/
2+
**/*.rs.bk

rust/Cargo.lock

Lines changed: 253 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[package]
2+
name = "julia-bench"
3+
publish = false
4+
version = "0.1.0"
5+
6+
[dependencies]
7+
itertools = "0.7.1"
8+
mersenne_twister = "1.1.1"
9+
num = "0.1.37"
10+
rand = "0.4.2"
11+
12+
[dependencies.cblas]
13+
version = "0.1.2"
14+
optional = true
15+
16+
[dependencies.cblas-sys]
17+
version = "0.1.4"
18+
19+
[dependencies.ndarray]
20+
features = ["blas"]
21+
version = "0.11.1"
22+
23+
[dependencies.blas-src]
24+
features = ["openblas"]
25+
default-features = false
26+
version = "0.1.2"
27+
28+
[dependencies.openblas-src]
29+
features = ["cblas", "system"]
30+
default-features = false
31+
version = "0.5.6"
32+
33+
[features]
34+
default = []
35+
direct_blas = ["cblas"]

rust/rust-toolchain

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nightly-2018-04-16

0 commit comments

Comments
 (0)