Skip to content

Commit

Permalink
Re-run benchmarks with --opt-level=3 as per #1. Results in modest imp…
Browse files Browse the repository at this point in the history
…rovement.
  • Loading branch information
BurntSushi committed Mar 28, 2014
1 parent 85a0be4 commit cd7577b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
RUST_CFG=

compile:
rustc -O ./src/lib.rs
rustc --opt-level=3 ./src/lib.rs

install:
cargo-lite install
Expand Down Expand Up @@ -31,7 +31,7 @@ bench: bench-runner
RUST_TEST_TASKS=1 RUST_LOG=quickcheck,csv ./bench-runner --bench

bench-runner: src/lib.rs src/test.rs src/bench.rs
rustc -O --test $(RUST_CFG) src/lib.rs -o bench-runner
rustc --opt-level=3 --test $(RUST_CFG) src/lib.rs -o bench-runner

test-clean:
rm -rf ./test-runner ./bench-runner
Expand Down
2 changes: 1 addition & 1 deletion bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Then compile and run:
To run the huge benchmark for Rust, make sure `ss10pusa.csv` is in the same
location as above and run:

rustc -O huge.rs -o huge-rust
rustc --opt-level=3 huge.rs -o huge-rust
time ./huge-rust

16 changes: 9 additions & 7 deletions bench/results
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
Benchmarks were run on an Intel i3930K. Note that the 'ns/iter' value is
computed by each language's microbenchmark facilities. I suspect the
granularity is big enough that the values are comparable.
Benchmarks were run on an Intel i3930K. Note that the
'ns/iter' value is computed by each language's microbenchmark facilities. I
suspect the granularity is big enough that the values are comparable.

For rust, --opt-level=3 was used.

Note that short = 398KB, medium = 1.4MB and large = 5.9MB.

Rust short 13313251 ns/iter (+/- 11342)
Rust short 12663308 ns/iter (+/- 11342)
Go short 13620130 ns/iter (100 iterations)
Rust medium 44827980 ns/iter (+/- 39679)
Rust medium 42487654 ns/iter (+/- 39679)
Go medium 45079987 ns/iter (50 iterations)
Rust large 202532195 ns/iter (+/- 437456)
Rust large 191634938 ns/iter (+/- 437456)
Go large 202660744 ns/iter (10 iterations)

You'll note that none of the above benchmarks use a particularly large CSV
Expand All @@ -20,6 +22,6 @@ The huge benchmark for both Rust and Go use buffering. The times are wall
clock times. The benchmark was run on an SSD. Both use a negligible and
constant amount of memory (~1KB).

Rust huge 141 seconds
Rust huge 133 seconds
Go huge 157 seconds

0 comments on commit cd7577b

Please sign in to comment.