From 078d8a6b9cd0d127bbf1f796fb506bfcb146c0a3 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 20 Oct 2019 10:30:29 +1100 Subject: [PATCH] Have script/bench-rust-gif print the rustc version --- script/bench-rust-gif/Cargo.toml | 1 + script/bench-rust-gif/src/main.rs | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/script/bench-rust-gif/Cargo.toml b/script/bench-rust-gif/Cargo.toml index 609f5902..61d69b49 100644 --- a/script/bench-rust-gif/Cargo.toml +++ b/script/bench-rust-gif/Cargo.toml @@ -5,3 +5,4 @@ authors = ["Nigel Tao "] [dependencies] gif = "*" +rustc_version_runtime = "*" diff --git a/script/bench-rust-gif/src/main.rs b/script/bench-rust-gif/src/main.rs index 37f9fe99..3e4b8a66 100644 --- a/script/bench-rust-gif/src/main.rs +++ b/script/bench-rust-gif/src/main.rs @@ -33,6 +33,7 @@ // handle duplicate names (https://github.com/rust-lang/cargo/issues/1311). extern crate gif; +extern crate rustc_version_runtime; use gif::SetParameter; use std::time::Instant; @@ -41,6 +42,18 @@ const ITERSCALE: u64 = 10; const REPS: u64 = 5; fn main() { + let version = rustc_version_runtime::version(); + print!( + "# Rust {}.{}.{}\n", + version.major, + version.minor, + version.patch + ); + print!("#\n"); + print!("# The output format, including the \"Benchmark\" prefixes, is compatible with the\n"); + print!("# https://godoc.org/golang.org/x/perf/cmd/benchstat tool. To install it, first\n"); + print!("# install Go, then run \"go get golang.org/x/perf/cmd/benchstat\".\n"); + let mut dst = vec![0u8; 64 * 1024 * 1024]; for _ in 0..REPS {