about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCorey Richardson <corey@octayn.net>2013-11-14 21:34:17 -0500
committerAlex Crichton <alex@alexcrichton.com>2014-01-24 22:30:00 -0800
commit7499e2dd4596893980aaed0ca0558eec89ce47ad (patch)
treee72740bcf7b472fb53f6ac8519086a13a471a326
parent69afce64c7b55b677e7a514a7ed28d17bde5b6aa (diff)
downloadrust-7499e2dd4596893980aaed0ca0558eec89ce47ad.tar.gz
rust-7499e2dd4596893980aaed0ca0558eec89ce47ad.zip
Add benchmarks
-rw-r--r--src/test/bench/silly-test-spawn.rs16
-rw-r--r--src/test/bench/spawnone.rs14
2 files changed, 30 insertions, 0 deletions
diff --git a/src/test/bench/silly-test-spawn.rs b/src/test/bench/silly-test-spawn.rs
new file mode 100644
index 00000000000..900796efe33
--- /dev/null
+++ b/src/test/bench/silly-test-spawn.rs
@@ -0,0 +1,16 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Useful smoketest for scheduler performance.
+fn main() {
+    for _ in range(1, 100_000) {
+        do spawn { }
+    }
+}
diff --git a/src/test/bench/spawnone.rs b/src/test/bench/spawnone.rs
new file mode 100644
index 00000000000..75485a7fb9e
--- /dev/null
+++ b/src/test/bench/spawnone.rs
@@ -0,0 +1,14 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Useful for checking syscall usage of baseline scheduler usage
+fn main() {
+    do spawn { }
+}