mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-25 06:03:16 +00:00
Add benchmarks
This commit is contained in:
parent
69afce64c7
commit
7499e2dd45
16
src/test/bench/silly-test-spawn.rs
Normal file
16
src/test/bench/silly-test-spawn.rs
Normal file
@ -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 { }
|
||||
}
|
||||
}
|
14
src/test/bench/spawnone.rs
Normal file
14
src/test/bench/spawnone.rs
Normal file
@ -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 { }
|
||||
}
|
Loading…
Reference in New Issue
Block a user